"use client"; import type { ReactNode } from "react"; import { SidebarTrigger } from "@/components/ui/sidebar"; /** * The 46px header every secondary page carries. * * It used to be `SecondaryShell`, which also mounted a `SidebarProvider` and a * sidebar of its own. Four routes rendering that shell meant four shells: every * arrival remounted the nav and re-issued `GET /api/sessions` and * `GET /api/account`, even when the reader had only stepped from `/chart` to * `/ephemeris`. The provider, the sidebar and the inset now live once, in * `app/(secondary)/layout.tsx`; what is left here is the header itself, which is * genuinely per page because only the page knows its name and its actions. * * The trigger still sits in this row — the provider is above it in the tree, so * `useSidebar()` resolves exactly as before. */ export type SecondaryHeaderProps = { /** Shown in the header. Pass a falsy value for pages that carry their own. */ readonly title: string; /** Right-aligned header controls: the one primary action, at most two. */ readonly actions?: ReactNode; /** A quiet chip beside the title — birth line, report date. */ readonly note?: ReactNode; /** Person switcher beside the title. Not the birth-line note. */ readonly besideTitle?: ReactNode; /** Keep the note slot so a late birth line cannot collapse the 46px row. */ readonly reserveNote?: boolean; }; export function SecondaryHeader({ title, actions, note, besideTitle, reserveNote = false }: SecondaryHeaderProps) { const showNote = Boolean(note) || reserveNote; return (
{title} {besideTitle} {showNote ? ( {note ?? "\u00a0"} ) : null}
{actions ?
{actions}
: null}
); }