37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { AuthedNav } from '@/components/layout/AuthedNav';
|
|
import { PublicNav } from '@/components/layout/PublicNav';
|
|
import { useCurrentSession } from '@/hooks/auth/useCurrentSession';
|
|
import { Box } from '@/ui/Box';
|
|
import { DashboardRail } from '@/components/dashboard/DashboardRail';
|
|
import { Text } from '@/ui/Text';
|
|
import { usePathname } from 'next/navigation';
|
|
|
|
export interface GlobalSidebarViewData {}
|
|
|
|
export function GlobalSidebarTemplate(_props: GlobalSidebarViewData) {
|
|
const pathname = usePathname();
|
|
const { data: session } = useCurrentSession();
|
|
const isAuthenticated = !!session;
|
|
|
|
return (
|
|
<DashboardRail>
|
|
<Box py={6}>
|
|
<Box px={6} mb={8}>
|
|
<Text size="xs" color="text-gray-500" weight="bold" font="mono" letterSpacing="0.2em">
|
|
NAVIGATION
|
|
</Text>
|
|
</Box>
|
|
<Box px={3}>
|
|
{isAuthenticated ? (
|
|
<AuthedNav pathname={pathname} />
|
|
) : (
|
|
<PublicNav pathname={pathname} />
|
|
)}
|
|
</Box>
|
|
</Box>
|
|
</DashboardRail>
|
|
);
|
|
}
|