'use client'; import { clsx } from 'clsx/lite'; import { usePathname } from 'next/navigation'; import Link from 'next/link'; import SiteGrid from '../components/SiteGrid'; import { SITE_DOMAIN_OR_TITLE } from '@/site/config'; import ViewSwitcher, { SwitcherSelection } from '@/site/ViewSwitcher'; import { PATH_ROOT, isPathGrid, isPathProtected, isPathSignIn, } from '@/site/paths'; import AnimateItems from '../components/AnimateItems'; export default function NavClient({ showAdmin, animate, }: { showAdmin?: boolean, animate?: boolean, }) { const pathname = usePathname(); const showNav = !isPathSignIn(pathname); const renderLink = ( text: string, linkOrAction: string | (() => void), ) => typeof linkOrAction === 'string' ? {text} : ; const switcherSelectionForPath = (): SwitcherSelection | undefined => { if (pathname === PATH_ROOT) { return 'full-frame'; } else if (isPathGrid(pathname)) { return 'grid'; } else if (isPathProtected(pathname)) { return 'admin'; } }; return (
{renderLink(SITE_DOMAIN_OR_TITLE, PATH_ROOT)}
] : []} /> } /> ); };