'use client'; import { cc } from '@/utility/css'; import { usePathname } from 'next/navigation'; import Link from 'next/link'; import SiteGrid from './SiteGrid'; import { SITE_DOMAIN_OR_TITLE } from '@/site/config'; import ViewSwitcher, { SwitcherSelection } from '@/photo/ViewSwitcher'; export default function Nav({ showTextLinks }: { showTextLinks?: boolean }) { const isLoggedIn = false; const pathname = usePathname(); const showNav = !pathname.startsWith('/sign-in'); const renderLink = ( text: string, linkOrAction: string | (() => void), ) => typeof linkOrAction === 'string' ? {text} : ; const switcherSelectionForPath = (): SwitcherSelection | undefined => { if (pathname === '/') { return 'full-frame'; } else if (pathname === '/grid') { return 'grid'; } else if (pathname.startsWith('/admin')) { return 'admin'; } }; return ( {showNav && <>
{showTextLinks && <> {renderLink('Home', '/')} {renderLink('Admin', '/admin')} }
{renderLink(SITE_DOMAIN_OR_TITLE, '/')}
} } /> ); };