import { CircleUser, Globe2, Lock, PlaneTakeoff, Server, Settings, Users, } from 'lucide-react'; import type { ReactNode } from 'react'; import { NavLink, useSubmit } from 'react-router'; import Menu from '~/components/Menu'; import { AuthSession } from '~/server/web/sessions'; import cn from '~/utils/cn'; interface Props { configAvailable: boolean; uiAccess: boolean; onboarding: boolean; user?: AuthSession['user']; } interface LinkProps { href: string; text: string; } interface TabLinkProps { name: string; to: string; icon: ReactNode; } function TabLink({ name, to, icon }: TabLinkProps) { return (
cn( 'px-3 py-2 flex items-center rounded-md text-nowrap gap-x-2.5', 'after:absolute after:bottom-0 after:left-3 after:right-3', 'after:h-0.5 after:bg-headplane-900 dark:after:bg-headplane-200', 'hover:bg-headplane-200 dark:hover:bg-headplane-900', 'focus:outline-none focus:ring', isActive ? 'after:visible' : 'after:invisible', ) } > {icon} {name}
); } function Link({ href, text }: LinkProps) { return ( {text} ); } export default function Header(data: Props) { const submit = useSubmit(); return (

headplane

{data.user ? ( {data.user.picture ? ( {data.user.name} ) : ( )} { if (key === 'logout') { submit( {}, { method: 'POST', action: '/logout', }, ); } }} disabledKeys={['profile']} >

{data.user.name}

{data.user.email}

Logout

) : undefined}
{data.uiAccess && !data.onboarding ? ( ) : undefined}
); }