import { AgentToggleButton } from "@agent-native/core/client/agent-chat"; import { useHeaderTitle, useHeaderActions, } from "@agent-native/toolkit/app-shell"; import type { ReactNode } from "react"; import { useLocation } from "react-router"; const pageTitles: Record = { "/": "Content", }; function resolveTitle(pathname: string): string { if (pageTitles[pathname]) return pageTitles[pathname]; if (pathname.startsWith("/page/")) return "Document"; if (pathname.startsWith("/extensions")) return "Extensions"; return "Content"; } interface HeaderProps { sidebarTrigger?: ReactNode; } export function Header({ sidebarTrigger }: HeaderProps) { const location = useLocation(); const title = useHeaderTitle(); const actions = useHeaderActions(); return (
{sidebarTrigger} {title ?? (

{resolveTitle(location.pathname)}

)}
{actions}
); }