export type DiffLine = string; // prefix with ' ', '+', or '-' /** * Unified diff hunk with a required one-line summary. Lines are prefixed with * '+', '-', or ' ' (context). Long hunks collapse via native
(zero JS). */ export function Diff({ file, summary, lines, collapsed = false, note, }: { file: string; summary: string; lines: DiffLine[]; collapsed?: boolean; note?: string; }) { const body = (
      {lines.map((ln, i) => {
        const kind = ln[0] === '+' ? 'add' : ln[0] === '-' ? 'del' : 'ctx';
        const bg = kind === 'add' ? 'var(--wf-add-soft)' : kind === 'del' ? 'var(--wf-del-soft)' : 'transparent';
        const fg = kind === 'add' ? 'var(--wf-add)' : kind === 'del' ? 'var(--wf-del)' : 'var(--wf-ink)';
        return (
          
{ln || ' '}
); })}
); return (
{file} — {summary} {body} {note &&
{note}
}
); }