import { AgentToggleButton } from "@agent-native/core/client/agent-chat"; import { useT } from "@agent-native/core/client/i18n"; import { RunsTray } from "@agent-native/core/client/progress"; import { useHeaderTitle, useHeaderActions, } from "@agent-native/toolkit/app-shell"; import { useLocation } from "react-router"; import { useDecks } from "@/context/DeckContext"; const pageTitleKeys: Record = { "/": "header.decks", "/design-systems": "header.designSystems", "/agent": "settings.agentTitle", "/settings": "header.settings", "/extensions": "header.extensions", }; function DeckTitle({ id }: { id: string }) { const { getDeck } = useDecks(); const t = useT(); const deck = getDeck(id); return (

{deck?.title || t("header.deck")}

); } function ResolvedTitle({ pathname }: { pathname: string }) { const t = useT(); if (pageTitleKeys[pathname]) { return (

{t(pageTitleKeys[pathname])}

); } const deckMatch = pathname.match(/^\/deck\/([^/]+)$/); if (deckMatch) return ; if (pathname.startsWith("/extensions/")) { return (

{t("header.tool")}

); } return (

{t("header.slides")}

); } export function Header() { const location = useLocation(); const title = useHeaderTitle(); const actions = useHeaderActions(); return (
{title ?? }
{actions}
); }