Added styled check button.

This commit is contained in:
2026-10-24 12:32:32 +02:00
parent 06fc8e3381
commit e0cd2f766e
2 changed files with 38 additions and 3 deletions
@@ -18,6 +18,7 @@
</script>
<script lang="ts">
import Checkbox from '#lib/components/checkbox.svelte';
import Table, { type Column } from '#lib/components/table.svelte';
const data: ScheduledTransaction[] = $state([
@@ -55,8 +56,7 @@
<Table {columns} {data} style={({ row }) => (row?.checked ? ['highlight'] : [])}>
{#snippet header({ key, label })}
{#if key === 'checked'}
<input
type="checkbox"
<Checkbox
onchange={(e) => data.forEach((row) => (row.checked = e.currentTarget.checked))}
checked={data.every((row) => row.checked)}
/>
@@ -66,7 +66,7 @@
{/snippet}
{#snippet cell({ key, value, row })}
{#if key === 'checked'}
<input type="checkbox" bind:checked={row.checked} />
<Checkbox bind:checked={row.checked} />
{:else}
{value}
{/if}