import type { ReactNode } from 'react'; import { cn } from '@/lib/cn'; /** * Editorial section: eyebrow/heading + subtitle on the left, optional actions on the right, a 1 px rule above. * Use instead of cards. `id` makes it linkable from TopicNav / TOC. */ export function Section({ id, title, subtitle, eyebrow, actions, children, className, level = 2, tight = false, }: { id?: string; title: ReactNode; subtitle?: ReactNode; eyebrow?: ReactNode; actions?: ReactNode; children: ReactNode; className?: string; level?: 2 | 3; tight?: boolean; }) { const H = level === 2 ? 'h2' : 'h3'; return (
{eyebrow ?
{eyebrow}
: null} {title} {subtitle ?

{subtitle}

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