Files
myeasycms-v2/apps/web/app/(dashboard)/home/[account]/_components/account-layout-sidebar-navigation.tsx
giancarlo 8281de12a0 Update i18n settings and upgrade dependencies in lockfile
This commit refactors the i18n settings in `i18n.settings.ts` to improve language handling. In addition, it updates the `pnpm-lock.yaml` file to upgrade the lockfile version and several package dependencies. Most notably, it integrates `tailwind-merge` and `@tanstack/react-table` into various packages.
2024-04-20 13:17:38 +08:00

58 lines
1.5 KiB
TypeScript

import { SidebarDivider, SidebarGroup, SidebarItem } from '@kit/ui/sidebar';
import { Trans } from '@kit/ui/trans';
import { getTeamAccountSidebarConfig } from '~/config/team-account-sidebar.config';
export function AccountLayoutSidebarNavigation({
account,
}: React.PropsWithChildren<{
account: string;
}>) {
const routes = getTeamAccountSidebarConfig(account).routes;
return (
<>
{routes.map((item, index) => {
if ('divider' in item) {
return <SidebarDivider key={index} />;
}
if ('children' in item) {
return (
<SidebarGroup
key={item.label}
label={<Trans i18nKey={item.label} defaults={item.label} />}
collapsible={item.collapsible}
collapsed={item.collapsed}
>
{item.children.map((child) => {
return (
<SidebarItem
key={child.path}
end={child.end}
path={child.path}
Icon={child.Icon}
>
<Trans i18nKey={child.label} defaults={child.label} />
</SidebarItem>
);
})}
</SidebarGroup>
);
}
return (
<SidebarItem
key={item.path}
end={item.end}
path={item.path}
Icon={item.Icon}
>
<Trans i18nKey={item.label} defaults={item.label} />
</SidebarItem>
);
})}
</>
);
}