mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 10:06:17 +08:00
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
|
import {
|
|
DeleteTemporarilyIcon,
|
|
FavoriteIcon,
|
|
FolderIcon,
|
|
SettingsIcon,
|
|
} from '@blocksuite/icons';
|
|
import type { FC, SVGProps } from 'react';
|
|
import { useMemo } from 'react';
|
|
|
|
import { pathGenerator } from '../../../shared';
|
|
export const useSwitchToConfig = (
|
|
workspaceId: string
|
|
): {
|
|
title: string;
|
|
href: string;
|
|
icon: FC<SVGProps<SVGSVGElement>>;
|
|
}[] => {
|
|
const t = useAFFiNEI18N();
|
|
return useMemo(
|
|
() => [
|
|
{
|
|
title: t['All pages'](),
|
|
href: pathGenerator.all(workspaceId),
|
|
icon: FolderIcon,
|
|
},
|
|
{
|
|
title: t['Favorites'](),
|
|
href: pathGenerator.favorite(workspaceId),
|
|
icon: FavoriteIcon,
|
|
},
|
|
{
|
|
title: t['Workspace Settings'](),
|
|
href: pathGenerator.setting(workspaceId),
|
|
icon: SettingsIcon,
|
|
},
|
|
{
|
|
title: t['Trash'](),
|
|
href: pathGenerator.trash(workspaceId),
|
|
icon: DeleteTemporarilyIcon,
|
|
},
|
|
],
|
|
[workspaceId, t]
|
|
);
|
|
};
|