import type { ReactNode } from "react"; import "@shared/components/PanelHeader.css"; import { IconBadge } from "@shared/components/IconBadge"; export interface PanelHeaderProps { title: ReactNode; /** Sub-heading below the title. */ subtitle?: ReactNode; /** Show a back chevron and trigger this callback when clicked. */ onBack?: () => void; /** Optional leading visual (e.g. a category glyph) shown in a tinted box. */ icon?: ReactNode; /** Accent tint for the leading icon box. Defaults to blue. */ iconAccent?: "blue" | "purple" | "green" | "amber" | "red"; /** Right-aligned action buttons / chips. */ actions?: ReactNode; className?: string; } /** * Header strip used by drill-down panels (admin tabs, agent detail, settings * sub-pages). Back chevron renders only when `onBack` is supplied; an optional * leading `icon` renders in a tinted box before the title. */ export function PanelHeader({ title, subtitle, onBack, icon, iconAccent = "blue", actions, className, }: PanelHeaderProps) { return (
{onBack && ( )} {icon && ( {icon} )}
{title}
{subtitle &&
{subtitle}
}
{actions &&
{actions}
}
); }