import { Toolbar } from '../Toolbar' import UserSidebarMenu from './UserSidebarMenu' import { ProjectWithEntryPointMetadata } from '../Router' import ProjectSidebarMenu from './ProjectSidebarMenu' import { useAuthMachine } from '../hooks/useAuthMachine' interface AppHeaderProps extends React.PropsWithChildren { showToolbar?: boolean project?: ProjectWithEntryPointMetadata className?: string enableMenu?: boolean } export const AppHeader = ({ showToolbar = true, project, children, className = '', enableMenu = false, }: AppHeaderProps) => { const [user] = useAuthMachine((s) => s?.context?.user) return (
{/* Toolbar if the context deems it */} {showToolbar && (
)} {/* If there are children, show them, otherwise show User menu */} {children || }
) }