Unified diff with tinted add and remove rows, line numbers, and +/− prefix column.
export function Button({ label }) {return <button>{label}</button>;return <button className="btn">{label}</button>;}
Requires shadcn/ui initialized. Run npx shadcn@latest init if you haven't.
import { Editor4 } from "@/components/beste/piece/editor4";
<Editor4
filename="button.tsx"
lines={[
{
"kind": "context",
"line": 12,
"content": "export function Button({ label }) {"
},
{
"kind": "remove",
"line": 13,
"content": " return <button>{label}</button>;"
},
{
"kind": "add",
"content": " return <button className=\"btn\">{label}</button>;"
},
{
"kind": "context",
"line": 14,
"content": "}"
}
]}
/>