import Link from 'next/link'; import type { ReactNode } from 'react'; import { cn } from '@/lib/cn'; /** Page-width wrapper. Pages render inside
without padding: wrap content in Container (1280) or wide (1600). */ export function Container({ children, className, wide = false }: { children: ReactNode; className?: string; wide?: boolean }) { return
{children}
; } /** Section with eyebrow + title + optional action link. Spatial composition with a hairline — not a card. */ export function Section({ eyebrow, title, lede, action, children, className, id, hairline = true, aside, }: { eyebrow?: string; title?: ReactNode; lede?: ReactNode; action?: { href: string; label: string }; children: ReactNode; className?: string; id?: string; hairline?: boolean; aside?: ReactNode; }) { return (
{(eyebrow || title) && (
{eyebrow &&

{eyebrow}

} {title &&

{title}

} {lede &&

{lede}

}
{aside} {action && ( {action.label} → )}
)} {children}
); } export function PageHeader({ eyebrow, title, lede, children, className, aside }: { eyebrow?: ReactNode; title: ReactNode; lede?: ReactNode; children?: ReactNode; className?: string; aside?: ReactNode }) { return (
{eyebrow &&
{eyebrow}
}

{title}

{lede &&

{lede}

}
{aside &&
{aside}
}
{children}
); } /** Stat tile: big tabular number + label + optional delta/hint. Composes in a hairline grid, never in a card. */ export function Stat({ label, value, hint, delta, className, accent = false, href, size = 'md' }: { label: ReactNode; value: ReactNode; hint?: ReactNode; delta?: { value: string; tone?: 'positive' | 'negative' | 'neutral' }; className?: string; accent?: boolean; href?: string; size?: 'sm' | 'md' | 'lg' }) { const body = ( <>

{label}

{value}

{(hint || delta) && (

{delta && {delta.value}} {hint}

)} ); if (href) return ( {body} ); return
{body}
; } export function StatGrid({ children, cols = 4, className }: { children: ReactNode; cols?: 2 | 3 | 4 | 5 | 6; className?: string }) { const desktop = { 2: 'md:grid-cols-2', 3: 'md:grid-cols-3', 4: 'md:grid-cols-4', 5: 'md:grid-cols-5', 6: 'md:grid-cols-3 lg:grid-cols-6' }[cols]; return
*]:border-b [&>*]:border-rule md:[&>*]:border-b-0', desktop, className)}>{children}
; } /** Small honest note. */ export function Note({ children, className }: { children: ReactNode; className?: string }) { return

{children}

; } /** Honest empty state — spec §165 wording. */ export function Empty({ title = 'No monitored evidence available yet.', children, className, compact = false }: { title?: string; children?: ReactNode; className?: string; compact?: boolean }) { return (

{title}

{children &&
{children}
}
); } export function Unavailable({ what = 'This panel', className, compact = false }: { what?: string; className?: string; compact?: boolean }) { return The dataset itself is intact — the API did not answer in time.; }