import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { ReactNode } from 'react'; import { useAuth } from '../lib/auth-context'; export default function Layout({ children, title }: { children: ReactNode; title?: string }) { const { user, memberships, activeOrg, setActiveOrgId, logout } = useAuth(); const router = useRouter(); return ( <> {title ? `${title} ยท UlHub` : 'UlHub'}
UlHub {user && ( <>
{memberships.length > 1 ? ( ) : ( {activeOrg?.org.name} )} {user.email}
)}
{children}
); }