"use client"; // Dependency-free unified-diff viewer (Batch 11). // // The web app keeps a minimal dependency footprint (next/react only), so rather // than pull in Monaco/an editor we render the proxied diff text with line-level // colouring. Read-only, scrollable, monospaced — enough to review a GitPilot // change in the browser before Matrix approves it. import { parseDiffLines, type DiffLineKind } from "@/lib/gitpilot-client"; const COLORS: Record = { add: { color: "#22c878", bg: "rgba(34,200,120,.10)" }, del: { color: "#ff6b6b", bg: "rgba(255,107,107,.10)" }, hunk: { color: "#53b9ff", bg: "rgba(83,185,255,.08)" }, meta: { color: "#8aa0b4", bg: "transparent" }, context: { color: "#c9d4df", bg: "transparent" }, }; export default function DiffView({ diff }: { diff: string }) { const lines = parseDiffLines(diff); if (!diff.trim()) { return
No diff to show.
; } return (
      {lines.map((l, i) => {
        const c = COLORS[l.kind];
        return (
          
{l.text || " "}
); })}
); }