import type { ReactNode } from 'react'; export type Column = { title: ReactNode; tone?: 'neutral' | 'before' | 'after'; children?: ReactNode; body?: ReactNode }; const TONE = { neutral: { bd: 'var(--wf-line)', fg: 'var(--wf-ink)' }, before: { bd: 'var(--wf-del)', fg: 'var(--wf-del)' }, after: { bd: 'var(--wf-ok)', fg: 'var(--wf-ok)' }, }; /** * Side-by-side comparison (before/after, option A/B). Provide column content * via `body` prop (data use) or as a single child per column. */ export function Columns({ columns, children }: { columns?: Column[]; children?: ReactNode }) { const cols = columns ?? []; return (
{cols.length ? cols.map((c, i) => { const t = TONE[c.tone ?? 'neutral']; return (
{c.title}
{c.body ?? c.children}
); }) : children}
); }