diff options
| author | Adam <[email protected]> | 2025-10-30 07:26:06 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-10-30 12:02:49 -0500 |
| commit | 30f4c2cf4c6c01339434c617fb9d930f6e960883 (patch) | |
| tree | db5da342a227724e11609e05f9e3c1fd6e2e7741 /packages/desktop/src/components/diff-changes.tsx | |
| parent | 3541fdcb2019676fb82351e909a8e9b740cb8237 (diff) | |
| download | opencode-30f4c2cf4c6c01339434c617fb9d930f6e960883.tar.gz opencode-30f4c2cf4c6c01339434c617fb9d930f6e960883.zip | |
wip: desktop work
Diffstat (limited to 'packages/desktop/src/components/diff-changes.tsx')
| -rw-r--r-- | packages/desktop/src/components/diff-changes.tsx | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/packages/desktop/src/components/diff-changes.tsx b/packages/desktop/src/components/diff-changes.tsx deleted file mode 100644 index 3b633f70f..000000000 --- a/packages/desktop/src/components/diff-changes.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { FileDiff } from "@opencode-ai/sdk" -import { createMemo, Show } from "solid-js" - -export function DiffChanges(props: { diff: FileDiff | FileDiff[] }) { - const additions = createMemo(() => - Array.isArray(props.diff) ? props.diff.reduce((acc, diff) => acc + (diff.additions ?? 0), 0) : props.diff.additions, - ) - const deletions = createMemo(() => - Array.isArray(props.diff) ? props.diff.reduce((acc, diff) => acc + (diff.deletions ?? 0), 0) : props.diff.deletions, - ) - const total = createMemo(() => additions() + deletions()) - return ( - <Show when={total() > 0}> - <div class="flex gap-2 justify-end items-center"> - <span class="text-12-mono text-right text-text-diff-add-base">{`+${additions()}`}</span> - <span class="text-12-mono text-right text-text-diff-delete-base">{`-${deletions()}`}</span> - </div> - </Show> - ) -} |
