chore: update i18n keys

This commit is contained in:
JimmFly
2023-01-10 14:29:18 +08:00
parent bc6cf648f6
commit 9fe4b066f9
23 changed files with 210 additions and 102 deletions
@@ -1,6 +1,9 @@
import React from 'react';
import { Empty } from '@/ui/empty';
export const PageListEmpty = () => {
import { useTranslation } from 'react-i18next';
export const PageListEmpty = (props: { listType: string }) => {
const { listType } = props;
const { t } = useTranslation();
return (
<div style={{ textAlign: 'center' }}>
<Empty
@@ -8,8 +11,10 @@ export const PageListEmpty = () => {
height={300}
sx={{ marginTop: '100px', marginBottom: '30px' }}
/>
<p>Tips: Click Add to Favourites/Trash and the page will appear here.</p>
<p>(Designer is grappling with designing)</p>
{listType === 'all' && <p>{t('emptyAllPages')}</p>}
{listType === 'favorite' && <p>{t('emptyFavourite')}</p>}
{listType === 'trash' && <p>{t('emptyTrash')}</p>}
<p>{t('still designed')}</p>
</div>
);
};
@@ -67,16 +67,18 @@ export const PageList = ({
pageList,
showFavoriteTag = false,
isTrash = false,
listType,
}: {
pageList: PageMeta[];
showFavoriteTag?: boolean;
isTrash?: boolean;
listType?: 'all' | 'trash' | 'favorite';
}) => {
const router = useRouter();
const { currentWorkspaceId } = useAppState();
const { t } = useTranslation();
if (pageList.length === 0) {
return <Empty />;
return <Empty listType={listType} />;
}
return (