import type { ReactNode } from 'react'; import { Icon, type IconName } from './Icon'; export type CalloutKind = 'decision' | 'warn' | 'ok' | 'note'; const KIND: Record = { decision: { fg: 'var(--wf-accent)', bg: 'var(--wf-accent-soft)', icon: 'check', label: 'Decision' }, warn: { fg: 'var(--wf-warn)', bg: 'var(--wf-warn-soft)', icon: 'bell', label: 'Risk' }, ok: { fg: 'var(--wf-ok)', bg: 'var(--wf-ok-soft)', icon: 'check', label: 'Confirmed' }, note: { fg: 'var(--wf-muted)', bg: 'var(--wf-card)', icon: 'more', label: 'Note' }, }; /** * Highlighted aside for decisions, risks, and notes. Use `decision` to make a * hard-to-reverse choice the headline; `warn` for risks. */ export function Callout({ kind = 'note', title, children }: { kind?: CalloutKind; title?: ReactNode; children: ReactNode }) { const k = KIND[kind]; return (
{title ?? k.label}
{children}
); }