This repository has no description
1<script lang="ts">
2 import type { DiffStat } from "$lib/api/diff";
3
4 interface Props {
5 stat: DiffStat;
6 class?: string;
7 }
8
9 let { stat, class: className = "" }: Props = $props();
10</script>
11
12{#if stat.insertions > 0 || stat.deletions > 0}
13 <div class="flex items-center font-mono typography-monospace-regular {className}">
14 {#if stat.insertions > 0 && stat.deletions > 0}
15 <span class="rounded-l bg-background-success-subtle p-1 text-foreground-success select-none">
16 +{stat.insertions}
17 </span>
18 <span class="rounded-r bg-background-danger-subtle p-1 text-foreground-danger select-none">
19 -{stat.deletions}
20 </span>
21 {:else if stat.insertions > 0}
22 <span class="rounded bg-background-success-subtle p-1 text-foreground-success select-none">
23 +{stat.insertions}
24 </span>
25 {:else}
26 <span class="rounded bg-background-danger-subtle p-1 text-foreground-danger select-none">
27 -{stat.deletions}
28 </span>
29 {/if}
30 </div>
31{/if}