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
69 lines
1.8 KiB
TypeScript
69 lines
1.8 KiB
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
|
|
import { LayoutDashboard, Users } from 'lucide-react';
|
|
|
|
import {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarFooter,
|
|
SidebarGroup,
|
|
SidebarGroupContent,
|
|
SidebarGroupLabel,
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
} from '@kit/ui/sidebar';
|
|
|
|
import { AppLogo } from '~/components/app-logo';
|
|
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
|
|
|
|
export function AdminSidebar() {
|
|
const path = usePathname();
|
|
|
|
return (
|
|
<Sidebar variant="floating" collapsible="icon">
|
|
<SidebarHeader className={'m-2'}>
|
|
<AppLogo href={'/admin'} className="max-w-full" />
|
|
</SidebarHeader>
|
|
|
|
<SidebarContent>
|
|
<SidebarGroup>
|
|
<SidebarGroupLabel>Super Admin</SidebarGroupLabel>
|
|
|
|
<SidebarGroupContent>
|
|
<SidebarMenu>
|
|
<SidebarMenuButton
|
|
isActive={path === '/admin'}
|
|
render={<Link className={'flex gap-2.5'} href={'/admin'} />}
|
|
>
|
|
<LayoutDashboard className={'h-4'} />
|
|
<span>Dashboard</span>
|
|
</SidebarMenuButton>
|
|
|
|
<SidebarMenuButton
|
|
isActive={path.includes('/admin/accounts')}
|
|
render={
|
|
<Link
|
|
className={'flex size-full gap-2.5'}
|
|
href={'/admin/accounts'}
|
|
>
|
|
<Users className={'h-4'} />
|
|
<span>Accounts</span>
|
|
</Link>
|
|
}
|
|
/>
|
|
</SidebarMenu>
|
|
</SidebarGroupContent>
|
|
</SidebarGroup>
|
|
</SidebarContent>
|
|
|
|
<SidebarFooter>
|
|
<ProfileAccountDropdownContainer />
|
|
</SidebarFooter>
|
|
</Sidebar>
|
|
);
|
|
}
|