Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { JWTUserData } from '@kit/supabase/types';
|
|
import { If } from '@kit/ui/if';
|
|
import { Sidebar, SidebarContent, SidebarHeader } from '@kit/ui/sidebar';
|
|
|
|
import type { AccountModel } from '~/components/workspace-dropdown';
|
|
import { WorkspaceDropdown } from '~/components/workspace-dropdown';
|
|
import featureFlagsConfig from '~/config/feature-flags.config';
|
|
import { getTeamAccountSidebarConfig } from '~/config/team-account-navigation.config';
|
|
import { TeamAccountNotifications } from '~/home/[account]/_components/team-account-notifications';
|
|
|
|
import { TeamAccountLayoutSidebarNavigation } from './team-account-layout-sidebar-navigation';
|
|
|
|
export function TeamAccountLayoutSidebar(props: {
|
|
account: string;
|
|
accountId: string;
|
|
accounts: AccountModel[];
|
|
user: JWTUserData;
|
|
}) {
|
|
const { account, accounts, user } = props;
|
|
|
|
const config = getTeamAccountSidebarConfig(account);
|
|
const collapsible = config.sidebarCollapsedStyle;
|
|
|
|
return (
|
|
<Sidebar variant="floating" collapsible={collapsible}>
|
|
<SidebarHeader className={'h-16 justify-center'}>
|
|
<div className={'flex items-center justify-between gap-x-1'}>
|
|
<WorkspaceDropdown
|
|
user={user}
|
|
accounts={accounts}
|
|
selectedAccount={account}
|
|
/>
|
|
|
|
<If condition={featureFlagsConfig.enableNotifications}>
|
|
<div className={'group-data-[collapsible=icon]:hidden'}>
|
|
<TeamAccountNotifications
|
|
userId={user.id}
|
|
accountId={props.accountId}
|
|
/>
|
|
</div>
|
|
</If>
|
|
</div>
|
|
</SidebarHeader>
|
|
|
|
<SidebarContent className="h-[calc(100%-160px)] overflow-y-auto">
|
|
<TeamAccountLayoutSidebarNavigation config={config} />
|
|
</SidebarContent>
|
|
</Sidebar>
|
|
);
|
|
}
|