import { parsePatch } from "@/lib/diff"; const lineStyles = { add: "bg-add-bg text-add", del: "bg-del-bg text-del", ctx: "text-fog", hunk: "bg-raise text-frost/80", } as const; export default function Diff({ patch }: { patch: string }) { const { stat, files } = parsePatch(patch); return (
{stat && (
          {stat}
        
)} {files.map((f) => (
{f.path} +{f.adds} −{f.dels}
{f.binary ? (

binary file changed

) : (
{f.lines.map((l, i) => ( ))}
{l.old ?? ""} {l.new ?? ""} {l.kind === "add" ? "+" : l.kind === "del" ? "−" : ""} {l.kind === "hunk" ? l.text : l.text || " "}
)}
))}
); }