import { cn } from "@/lib/utils"; type PanelVariant = "flat" | "surface"; type PanelDensity = "normal" | "compact" | "dense"; type PanelProps = { title?: string; subtitle?: string; actions?: React.ReactNode; children: React.ReactNode; className?: string; variant?: PanelVariant; density?: PanelDensity; }; const densityStyles: Record = { normal: "", compact: "", dense: "", }; const headerDensityStyles: Record = { normal: "mb-4", compact: "mb-3", dense: "mb-2", }; export function Panel({ title, subtitle, actions, children, className, variant = "flat", density = "normal", }: PanelProps) { const surfaceStyles = density === "normal" ? "p-4 sm:p-5" : density === "compact" ? "p-3 sm:p-4" : "p-2.5 sm:p-3"; const flatStyles = density === "normal" ? "pt-4 sm:pt-5" : density === "compact" ? "pt-3 sm:pt-4" : "pt-2.5 sm:pt-3"; return (
{title || subtitle || actions ? (
{title ? (

{title}

) : null} {subtitle ? (

{subtitle}

) : null}
{actions ?
{actions}
: null}
) : null} {children}
); }