Numerous component files have been renamed for better organization and readability. This includes changing 'app' to 'account-layout' in various instances and 'organization' to 'team' to ensure consistency across code. Additionally, dependencies within codes have been updated in line with the renaming. The pull request also includes a minor update to the pnpm-lock file, reflecting the latest version of Next.js.
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
'use client';
|
|
|
|
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;
|
|
}>) {
|
|
return (
|
|
<>
|
|
{getTeamAccountSidebarConfig(account).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>
|
|
);
|
|
})}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default AccountLayoutSidebarNavigation;
|