import type { ReactNode } from "react"; import "@shared/components/SettingsShell.css"; export interface SettingsNavItem { key: string; label: string; /** Optional leading glyph. */ icon?: ReactNode; /** Optional trailing badge (e.g. a plan gate or count). */ badge?: ReactNode; disabled?: boolean; } export interface SettingsNavSection { /** Uppercase group heading above its items. */ title: string; items: SettingsNavItem[]; } export interface SettingsShellProps { sections: SettingsNavSection[]; activeKey: string; onSelect: (key: string) => void; /** Heading for the content pane — usually the active item's label. */ title: ReactNode; /** Renders a close button at the top-right of the content header. */ onClose?: () => void; /** Extra header controls (e.g. a search field) left of the close button. */ headerActions?: ReactNode; /** Sticky footer, e.g. Save / Cancel. */ footer?: ReactNode; /** Active section content. */ children: ReactNode; className?: string; } /** * Two-pane settings layout: a grouped left navigation rail and a content pane * with a sticky header (active title + actions) and an optional sticky footer. * * Layout chrome only — the caller owns section state and renders the active * panel as `children`. Host it inside any modal/dialog frame (it fills its * container's height and scrolls the two panes independently). Shared so the * portal and the editor can present account settings the same way. */ export function SettingsShell({ sections, activeKey, onSelect, title, onClose, headerActions, footer, children, className, }: SettingsShellProps) { return (