Tables
DiffTable
Renders code diffs in unified or split view with added/removed line counts, accept/reject hunk actions, and syntax-highlighted monospace display.
Preview:1280px
11
| @@ Changes @@ | |||
| 1 | 1 | export function greet(name: string) { | |
| 2 | − | return 'Hello, ' + name; | |
| 2 | + | return `Hello, ${name}!`; | |
| 3 | 3 | } | |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| hunks | DiffHunk[] | - | Array of diff hunks to render. |
| mode | 'unified' | 'split' | 'unified' | Diff display mode. |
| onAccept | (hunkId: string) => void | - | Fired when the user clicks Accept on a hunk. |
| onReject | (hunkId: string) => void | - | Fired when the user clicks Reject on a hunk. |