From 50f19663d45e1d02f75e4579dfdad8ea0a2b01c6 Mon Sep 17 00:00:00 2001
From: himself65
Date: Mon, 2 Jan 2023 00:57:08 +0800
Subject: [PATCH 01/14] build: enhance debugging with blocksuite
---
packages/app/next.config.js | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/packages/app/next.config.js b/packages/app/next.config.js
index 20f12e5770..6d7225864c 100644
--- a/packages/app/next.config.js
+++ b/packages/app/next.config.js
@@ -4,6 +4,11 @@ const { dependencies } = require('./package.json');
const path = require('node:path');
const printer = require('./scripts/printer').printer;
+const enableDebugLocal = path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? '');
+const EDITOR_VERSION = enableDebugLocal
+ ? 'local-version'
+ : dependencies['@blocksuite/editor'];
+
/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
@@ -16,7 +21,7 @@ const nextConfig = {
CI: process.env.CI || null,
VERSION: getGitVersion(),
COMMIT_HASH: getCommitHash(),
- EDITOR_VERSION: dependencies['@blocksuite/editor'],
+ EDITOR_VERSION,
},
webpack: config => {
config.experiments = { ...config.experiments, topLevelAwait: true };
@@ -63,11 +68,25 @@ const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/';
const withDebugLocal = require('next-debug-local')(
{
'@blocksuite/editor': path.resolve(baseDir, 'packages', 'editor'),
+ '@blocksuite/blocks/models': path.resolve(
+ baseDir,
+ 'packages',
+ 'blocks',
+ 'src',
+ 'models'
+ ),
+ '@blocksuite/blocks/std': path.resolve(
+ baseDir,
+ 'packages',
+ 'blocks',
+ 'src',
+ 'std'
+ ),
'@blocksuite/blocks': path.resolve(baseDir, 'packages', 'blocks'),
'@blocksuite/store': path.resolve(baseDir, 'packages', 'store'),
},
{
- enable: path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? ''),
+ enable: enableDebugLocal,
}
);
From ae94c901b3b9547706f1db98bc89e9e69668d825 Mon Sep 17 00:00:00 2001
From: DarkSky
Date: Wed, 4 Jan 2023 16:49:40 +0800
Subject: [PATCH 02/14] feat: auth implement
---
packages/data-center/src/apis/token.ts | 27 ++++++++++++++++---
packages/data-center/src/datacenter.ts | 15 +++++++++++
packages/data-center/src/index.ts | 4 +++
.../data-center/src/provider/affine/index.ts | 26 ++++++++++++++++--
packages/data-center/src/provider/base.ts | 4 +++
.../data-center/src/provider/local/index.ts | 16 ++++++++---
6 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/packages/data-center/src/apis/token.ts b/packages/data-center/src/apis/token.ts
index b0acf68ee3..c509da0f33 100644
--- a/packages/data-center/src/apis/token.ts
+++ b/packages/data-center/src/apis/token.ts
@@ -60,7 +60,9 @@ class Token {
}
async initToken(token: string) {
- this._setToken(await login({ token, type: 'Google' }));
+ const tokens = await login({ token, type: 'Google' });
+ this._setToken(tokens);
+ return this._user;
}
async refreshToken(token?: string) {
@@ -153,10 +155,27 @@ export const getAuthorizer = () => {
const googleAuthProvider = new GoogleAuthProvider();
+ const getToken = async () => {
+ const currentUser = firebaseAuth.currentUser;
+ if (currentUser) {
+ await currentUser.getIdTokenResult(true);
+ if (!currentUser.isAnonymous) {
+ return currentUser.getIdToken();
+ }
+ }
+ return;
+ };
+
const signInWithGoogle = async () => {
- const user = await signInWithPopup(firebaseAuth, googleAuthProvider);
- const idToken = await user.user.getIdToken();
- await token.initToken(idToken);
+ const idToken = await getToken();
+ if (idToken) {
+ await token.initToken(idToken);
+ } else {
+ const user = await signInWithPopup(firebaseAuth, googleAuthProvider);
+ const idToken = await user.user.getIdToken();
+ await token.initToken(idToken);
+ }
+ return firebaseAuth.currentUser;
};
const onAuthStateChanged = (callback: (user: User | null) => void) => {
diff --git a/packages/data-center/src/datacenter.ts b/packages/data-center/src/datacenter.ts
index 62edea334d..a094b9def6 100644
--- a/packages/data-center/src/datacenter.ts
+++ b/packages/data-center/src/datacenter.ts
@@ -97,6 +97,21 @@ export class DataCenter {
return provider;
}
+ async auth(providerId: string, globalConfig?: Record) {
+ const Provider = this._providers.get(providerId);
+ if (Provider) {
+ // initial configurator
+ const config = getKVConfigure(`provider:${providerId}`);
+ // set workspace configs
+ const values = Object.entries(globalConfig || {});
+ if (values.length) await config.setMany(values);
+
+ const logger = this._logger.extend(`auth:${providerId}`);
+ logger.enabled = this._logger.enabled;
+ await Provider.auth(config, logger);
+ }
+ }
+
/**
* load workspace data to memory
* @param workspaceId workspace id
diff --git a/packages/data-center/src/index.ts b/packages/data-center/src/index.ts
index 68aa74b916..72aa6015e1 100644
--- a/packages/data-center/src/index.ts
+++ b/packages/data-center/src/index.ts
@@ -7,6 +7,10 @@ const _initializeDataCenter = () => {
return (debug = true) => {
if (!_dataCenterInstance) {
_dataCenterInstance = DataCenter.init(debug);
+ _dataCenterInstance.then(dc => {
+ (window as any).dc = dc;
+ return dc;
+ });
}
return _dataCenterInstance;
diff --git a/packages/data-center/src/provider/affine/index.ts b/packages/data-center/src/provider/affine/index.ts
index fef7a4d0a9..6f1824a152 100644
--- a/packages/data-center/src/provider/affine/index.ts
+++ b/packages/data-center/src/provider/affine/index.ts
@@ -1,8 +1,8 @@
import assert from 'assert';
import { applyUpdate } from 'yjs';
-import type { InitialParams } from '../index.js';
-import { token, Callback } from '../../apis/index.js';
+import type { ConfigStore, InitialParams, Logger } from '../index.js';
+import { token, Callback, getApis } from '../../apis/index.js';
import { LocalProvider } from '../local/index.js';
import { WebsocketProvider } from './sync.js';
@@ -91,4 +91,26 @@ export class AffineProvider extends LocalProvider {
// just a workaround for yjs
doc.getMap('space:meta');
}
+
+ static async auth(config: Readonly>, logger: Logger) {
+ const refreshToken = await config.get('token');
+ if (refreshToken) {
+ await token.refreshToken(refreshToken);
+ if (token.isLogin && !token.isExpired) {
+ logger('check login success');
+ // login success
+ return;
+ }
+ }
+
+ logger('start login');
+ // login with google
+ const apis = getApis();
+ assert(apis.signInWithGoogle);
+ const user = await apis.signInWithGoogle();
+ assert(user);
+ logger(`login success: ${user.displayName}`);
+
+ // TODO: refresh local workspace data
+ }
}
diff --git a/packages/data-center/src/provider/base.ts b/packages/data-center/src/provider/base.ts
index 95bd309a1c..8ed184b6eb 100644
--- a/packages/data-center/src/provider/base.ts
+++ b/packages/data-center/src/provider/base.ts
@@ -55,6 +55,10 @@ export class BaseProvider {
return this._workspace;
}
+ static async auth(_config: Readonly, _logger: Logger) {
+ throw Error('Not implemented: auth');
+ }
+
// get workspace list,return a map of workspace id and boolean
// if value is true, it exists locally, otherwise it does not exist locally
static async list(
diff --git a/packages/data-center/src/provider/local/index.ts b/packages/data-center/src/provider/local/index.ts
index d2ced1b9ee..89ec6ce192 100644
--- a/packages/data-center/src/provider/local/index.ts
+++ b/packages/data-center/src/provider/local/index.ts
@@ -1,7 +1,7 @@
import type { BlobStorage } from '@blocksuite/store';
import assert from 'assert';
-import type { ConfigStore, InitialParams } from '../index.js';
+import type { ConfigStore, InitialParams, Logger } from '../index.js';
import { BaseProvider } from '../base.js';
import { IndexedDBProvider } from './indexeddb.js';
@@ -32,14 +32,14 @@ export class LocalProvider extends BaseProvider {
await this._idb.whenSynced;
this._logger('Local data loaded');
- await this._globalConfig.set(this._workspace.room, true);
+ await this._globalConfig.set(`list:${this._workspace.room}`, true);
}
async clear() {
await super.clear();
await this._blobs.clear();
await this._idb?.clearData();
- await this._globalConfig.delete(this._workspace.room!);
+ await this._globalConfig.delete(`list:${this._workspace.room}`);
}
async destroy(): Promise {
@@ -55,10 +55,18 @@ export class LocalProvider extends BaseProvider {
return this._blobs.set(blob);
}
+ static async auth(_config: Readonly, logger: Logger) {
+ logger("Local provider doesn't require authentication");
+ }
+
static async list(
config: Readonly>
): Promise
Copyright © 2022 Toeverything
diff --git a/packages/app/src/components/editor-mode-switch/index.tsx b/packages/app/src/components/editor-mode-switch/index.tsx
index 8a219e4757..86a54d8606 100644
--- a/packages/app/src/components/editor-mode-switch/index.tsx
+++ b/packages/app/src/components/editor-mode-switch/index.tsx
@@ -15,7 +15,7 @@ import { useTheme } from '@/providers/themeProvider';
import { EdgelessIcon, PaperIcon } from './icons';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { usePageHelper } from '@/hooks/use-page-helper';
-
+import { useTranslation } from 'react-i18next';
const PaperItem = ({ active }: { active?: boolean }) => {
const {
theme: {
@@ -96,7 +96,7 @@ export const EditorModeSwitch = ({
setRadioItemStatus(modifyRadioItemStatus());
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isHover, mode]);
-
+ const { t } = useTranslation();
return (
}
active={mode === 'page'}
status={radioItemStatus.left}
@@ -126,7 +126,7 @@ export const EditorModeSwitch = ({
}
active={mode === 'edgeless'}
diff --git a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx
index ea71aef757..738e344d48 100644
--- a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx
+++ b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx
@@ -16,12 +16,13 @@ import { usePageHelper } from '@/hooks/use-page-helper';
import { useConfirm } from '@/providers/confirm-provider';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { toast } from '@/ui/toast';
-
+import { useTranslation } from 'react-i18next';
const PopoverContent = () => {
const { editor } = useAppState();
const { toggleFavoritePage, toggleDeletePage } = usePageHelper();
const { changePageMode } = usePageHelper();
const { confirm } = useConfirm();
+ const { t } = useTranslation();
const {
mode = 'page',
id = '',
@@ -35,11 +36,13 @@ const PopoverContent = () => {
data-testid="editor-option-menu-favorite"
onClick={() => {
toggleFavoritePage(id);
- toast(!favorite ? 'Removed to Favourites' : 'Added to Favourites');
+ toast(
+ !favorite ? t('Removed to Favourites') : t('Added to Favourites')
+ );
}}
icon={favorite ? : }
>
- {favorite ? 'Remove' : 'Add'} to favourites
+ {favorite ? t('Remove to favourites') : t('Add to favourites')}
: }
@@ -48,7 +51,8 @@ const PopoverContent = () => {
changePageMode(id, mode === 'page' ? 'edgeless' : 'page');
}}
>
- Convert to {mode === 'page' ? 'Edgeless' : 'Page'}
+ {t('Convert to ')}
+ {mode === 'page' ? t('Edgeless') : t('Page')}
>
);
diff --git a/packages/app/src/components/header/quick-search-button.tsx b/packages/app/src/components/header/quick-search-button.tsx
index a08c61bf65..e45e78fed4 100644
--- a/packages/app/src/components/header/quick-search-button.tsx
+++ b/packages/app/src/components/header/quick-search-button.tsx
@@ -3,15 +3,15 @@ import { IconButton, IconButtonProps } from '@/ui/button';
import { Tooltip } from '@/ui/tooltip';
import { ArrowDownIcon } from '@blocksuite/icons';
import { useModal } from '@/providers/global-modal-provider';
-
+import { useTranslation } from 'react-i18next';
export const QuickSearchButton = ({
onClick,
...props
}: Omit) => {
const { triggerQuickSearchModal } = useModal();
-
+ const { t } = useTranslation();
return (
-
+
{showList.includes('contact') && (
-
+
)}
{showList.includes('shortcuts') && (
-
+
{
const [status, setStatus] = useState<'unImported' | 'importing'>('importing');
const { openPage, createPage } = usePageHelper();
const { currentWorkspace } = useAppState();
+ const { t } = useTranslation();
const _applyTemplate = function (pageId: string, template: Template) {
const page = currentWorkspace?.getPage(pageId);
@@ -84,7 +86,7 @@ export const ImportModal = ({ open, onClose }: ImportModalProps) => {
- Import
+ {t('Import')}
{status === 'unImported' && (
diff --git a/packages/app/src/components/page-list/operation-cell.tsx b/packages/app/src/components/page-list/operation-cell.tsx
index 7416b65d9a..3052199c4d 100644
--- a/packages/app/src/components/page-list/operation-cell.tsx
+++ b/packages/app/src/components/page-list/operation-cell.tsx
@@ -14,23 +14,25 @@ import {
} from '@blocksuite/icons';
import { toast } from '@/ui/toast';
import { usePageHelper } from '@/hooks/use-page-helper';
-
+import { useTranslation } from 'react-i18next';
export const OperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
const { id, favorite } = pageMeta;
const { openPage } = usePageHelper();
const { toggleFavoritePage, toggleDeletePage } = usePageHelper();
const { confirm } = useConfirm();
-
+ const { t } = useTranslation();
const OperationMenu = (
<>
>
);
@@ -74,7 +78,7 @@ export const TrashOperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
const { openPage, getPageMeta } = usePageHelper();
const { toggleDeletePage, permanentlyDeletePage } = usePageHelper();
const { confirm } = useConfirm();
-
+ const { t } = useTranslation();
return (
{
style={{ marginRight: '12px' }}
onClick={() => {
toggleDeletePage(id);
- toast(`${getPageMeta(id)?.title || 'Untitled'} restored`);
+ toast(t('restored', { title: getPageMeta(id)?.title || 'Untitled' }));
openPage(id);
}}
>
@@ -92,13 +96,13 @@ export const TrashOperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
darker={true}
onClick={() => {
confirm({
- title: 'Delete permanently?',
- content: "Once deleted, you can't undo this action.",
- confirmText: 'Delete',
+ title: t('Delete permanently?'),
+ content: t("Once deleted, you can't undo this action."),
+ confirmText: t('Delete'),
confirmType: 'danger',
}).then(confirm => {
confirm && permanentlyDeletePage(id);
- toast('Permanently deleted');
+ toast(t('Permanently deleted'));
});
}}
>
diff --git a/packages/app/src/components/quick-search/footer.tsx b/packages/app/src/components/quick-search/footer.tsx
index 5f03b6c85e..48914cda73 100644
--- a/packages/app/src/components/quick-search/footer.tsx
+++ b/packages/app/src/components/quick-search/footer.tsx
@@ -4,10 +4,11 @@ import { StyledModalFooterContent } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { Command } from 'cmdk';
import { usePageHelper } from '@/hooks/use-page-helper';
-
+import { useTranslation } from 'react-i18next';
export const Footer = (props: { query: string }) => {
const { triggerQuickSearchModal } = useModal();
const { openPage, createPage } = usePageHelper();
+ const { t } = useTranslation();
const query = props.query;
return (
@@ -25,9 +26,9 @@ export const Footer = (props: { query: string }) => {
{query ? (
- New "{query}" page
+ {t('New Keyword Page', { query: query })}
) : (
- New page
+ {t('New Page')}
)}
diff --git a/packages/app/src/components/quick-search/results.tsx b/packages/app/src/components/quick-search/results.tsx
index 2a99e389ff..2c2abd9026 100644
--- a/packages/app/src/components/quick-search/results.tsx
+++ b/packages/app/src/components/quick-search/results.tsx
@@ -7,6 +7,7 @@ import { useAppState } from '@/providers/app-state-provider';
import { useRouter } from 'next/router';
import { config } from './config';
import { NoResultSVG } from './noResultSVG';
+import { useTranslation } from 'react-i18next';
import usePageHelper from '@/hooks/use-page-helper';
import usePageMetaList from '@/hooks/use-page-meta-list';
export const Results = (props: {
@@ -27,6 +28,7 @@ export const Results = (props: {
const { search } = usePageHelper();
const List = config(currentWorkspaceId);
const [results, setResults] = useState(new Map());
+ const { t } = useTranslation();
useEffect(() => {
setResults(search(query));
setLoading(false);
@@ -47,7 +49,9 @@ export const Results = (props: {
<>
{query ? (
resultsPageMeta.length ? (
-
+
{resultsPageMeta.map(result => {
return (
) : (
- Find 0 result
+ {t('Find 0 result')}
)
) : (
-
+
{List.map(link => {
return (
void;
@@ -27,11 +28,12 @@ const isMac = () => {
export const ShortcutsModal = ({ open, onClose }: ModalProps) => {
const markdownShortcuts = isMac()
- ? macMarkdownShortcuts
- : winMarkdownShortcuts;
+ ? macMarkdownShortcuts()
+ : winMarkdownShortcuts();
const keyboardShortcuts = isMac()
- ? macKeyboardShortcuts
- : windowsKeyboardShortcuts;
+ ? macKeyboardShortcuts()
+ : windowsKeyboardShortcuts();
+ const { t } = useTranslation();
return createPortal(
@@ -39,7 +41,7 @@ export const ShortcutsModal = ({ open, onClose }: ModalProps) => {
- Shortcuts
+ {t('Shortcuts')}
{
/>
- Keyboard Shortcuts
+ {t('Keyboard Shortcuts')}
{Object.entries(keyboardShortcuts).map(([title, shortcuts]) => {
return (
@@ -63,7 +65,7 @@ export const ShortcutsModal = ({ open, onClose }: ModalProps) => {
);
})}
- Markdown Syntax
+ {t('Markdown Syntax')}
{Object.entries(markdownShortcuts).map(([title, shortcuts]) => {
return (
diff --git a/packages/app/src/components/workspace-slider-bar/index.tsx b/packages/app/src/components/workspace-slider-bar/index.tsx
index 4d164e4233..0924752ac2 100644
--- a/packages/app/src/components/workspace-slider-bar/index.tsx
+++ b/packages/app/src/components/workspace-slider-bar/index.tsx
@@ -25,18 +25,18 @@ import Link from 'next/link';
import { Tooltip } from '@/ui/tooltip';
import { useModal } from '@/providers/global-modal-provider';
import { useAppState } from '@/providers/app-state-provider/context';
-
import { IconButton } from '@/ui/button';
// import { WorkspaceSelector } from './WorkspaceSelector';
import useLocalStorage from '@/hooks/use-local-storage';
import usePageMetaList from '@/hooks/use-page-meta-list';
import { usePageHelper } from '@/hooks/use-page-helper';
+import { useTranslation } from 'react-i18next';
const FavoriteList = ({ showList }: { showList: boolean }) => {
const { openPage } = usePageHelper();
const pageList = usePageMetaList();
const router = useRouter();
-
+ const { t } = useTranslation();
const favoriteList = pageList.filter(p => p.favorite && !p.trash);
return (
@@ -59,7 +59,7 @@ const FavoriteList = ({ showList }: { showList: boolean }) => {
);
})}
{favoriteList.length === 0 && (
- No item
+ {t('No item')}
)}
);
@@ -70,7 +70,7 @@ export const WorkSpaceSliderBar = () => {
const { currentWorkspaceId } = useAppState();
const { openPage, createPage } = usePageHelper();
const router = useRouter();
-
+ const { t } = useTranslation();
const [showTip, setShowTip] = useState(false);
const [show, setShow] = useLocalStorage('AFFiNE_SLIDE_BAR', false, true);
@@ -86,7 +86,7 @@ export const WorkSpaceSliderBar = () => {
<>
@@ -120,17 +120,17 @@ export const WorkSpaceSliderBar = () => {
}}
>
- Quick search
+ {t('Quick search')}
- All pages
+ {t('All pages')}
- Favourites
+ {t('Favourites')}
{
triggerImportModal();
}}
>
- Import
+ {t('Import')}
- Trash
+ {t('Trash')}
{
}
}}
>
- New Page
+ {t('New Page')}
diff --git a/packages/app/src/pages/workspace/[workspaceId]/all.tsx b/packages/app/src/pages/workspace/[workspaceId]/all.tsx
index dacb16bd59..18f6e2a64b 100644
--- a/packages/app/src/pages/workspace/[workspaceId]/all.tsx
+++ b/packages/app/src/pages/workspace/[workspaceId]/all.tsx
@@ -4,13 +4,13 @@ import usePageMetaList from '@/hooks/use-page-meta-list';
import { PageListHeader } from '@/components/header';
import { ReactElement } from 'react';
import WorkspaceLayout from '@/components/workspace-layout';
-
+import { useTranslation } from 'react-i18next';
const All = () => {
const pageMetaList = usePageMetaList();
-
+ const { t } = useTranslation();
return (
<>
- }>All Page
+ }>{t('All pages')}
!p.trash)}
showFavoriteTag={true}
diff --git a/packages/app/src/pages/workspace/[workspaceId]/favorite.tsx b/packages/app/src/pages/workspace/[workspaceId]/favorite.tsx
index bde04923d6..d787f34e1b 100644
--- a/packages/app/src/pages/workspace/[workspaceId]/favorite.tsx
+++ b/packages/app/src/pages/workspace/[workspaceId]/favorite.tsx
@@ -4,12 +4,15 @@ import { FavouritesIcon } from '@blocksuite/icons';
import usePageMetaList from '@/hooks/use-page-meta-list';
import { ReactElement } from 'react';
import WorkspaceLayout from '@/components/workspace-layout';
-
+import { useTranslation } from 'react-i18next';
export const Favorite = () => {
const pageMetaList = usePageMetaList();
+ const { t } = useTranslation();
return (
<>
- }>Favourites
+ }>
+ {t('Favourites')}
+
p.favorite && !p.trash)} />
>
);
diff --git a/packages/app/src/pages/workspace/[workspaceId]/trash.tsx b/packages/app/src/pages/workspace/[workspaceId]/trash.tsx
index 9e7f397669..2343b39138 100644
--- a/packages/app/src/pages/workspace/[workspaceId]/trash.tsx
+++ b/packages/app/src/pages/workspace/[workspaceId]/trash.tsx
@@ -4,12 +4,13 @@ import { TrashIcon } from '@blocksuite/icons';
import usePageMetaList from '@/hooks/use-page-meta-list';
import { ReactElement } from 'react';
import WorkspaceLayout from '@/components/workspace-layout';
-
+import { useTranslation } from 'react-i18next';
export const Trash = () => {
const pageMetaList = usePageMetaList();
+ const { t } = useTranslation();
return (
<>
- }>Trash
+ }>{t('Trash')}
p.trash)} isTrash={true} />
>
);
diff --git a/packages/app/src/ui/confirm/Confirm.tsx b/packages/app/src/ui/confirm/Confirm.tsx
index d3de35adb1..bbffe75f65 100644
--- a/packages/app/src/ui/confirm/Confirm.tsx
+++ b/packages/app/src/ui/confirm/Confirm.tsx
@@ -7,6 +7,7 @@ import {
StyledModalWrapper,
} from '@/ui/confirm/styles';
import { Button } from '@/ui/button';
+import { useTranslation } from 'react-i18next';
export type ConfirmProps = {
title?: string;
content?: string;
@@ -26,6 +27,7 @@ export const Confirm = ({
onCancel,
}: ConfirmProps) => {
const [open, setOpen] = useState(true);
+ const { t } = useTranslation();
return (
@@ -48,7 +50,7 @@ export const Confirm = ({
}}
style={{ marginRight: '24px' }}
>
- Cancel
+ {t('Cancel')}