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
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { If } from '@kit/ui/if';
|
|
import { Sidebar, SidebarContent, SidebarHeader } from '@kit/ui/sidebar';
|
|
import { SidebarNavigation } from '@kit/ui/sidebar-navigation';
|
|
|
|
import { WorkspaceDropdown } from '~/components/workspace-dropdown';
|
|
import featuresFlagConfig from '~/config/feature-flags.config';
|
|
import { personalAccountNavigationConfig } from '~/config/personal-account-navigation.config';
|
|
import { UserNotifications } from '~/home/(user)/_components/user-notifications';
|
|
|
|
// home imports
|
|
import type { UserWorkspace } from '../_lib/server/load-user-workspace';
|
|
|
|
interface HomeSidebarProps {
|
|
workspace: UserWorkspace;
|
|
}
|
|
|
|
export function HomeSidebar(props: HomeSidebarProps) {
|
|
const { workspace, user, accounts } = props.workspace;
|
|
const collapsible = personalAccountNavigationConfig.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}
|
|
workspace={workspace}
|
|
/>
|
|
|
|
<If condition={featuresFlagConfig.enableNotifications}>
|
|
<div className={'group-data-[collapsible=icon]:hidden'}>
|
|
<UserNotifications userId={user.id} />
|
|
</div>
|
|
</If>
|
|
</div>
|
|
</SidebarHeader>
|
|
|
|
<SidebarContent>
|
|
<SidebarNavigation config={personalAccountNavigationConfig} />
|
|
</SidebarContent>
|
|
</Sidebar>
|
|
);
|
|
}
|