From a9866654acde4cd8cd3b8719998869e8ea367f3e Mon Sep 17 00:00:00 2001 From: Rogier Reerink Date: Sat, 24 Oct 2026 10:35:10 +0200 Subject: [PATCH] Might be better DX. --- web/src/lib/components/table.svelte | 7 ++++--- web/src/routes/scheduled-transactions/+page.svelte | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web/src/lib/components/table.svelte b/web/src/lib/components/table.svelte index abd9537..8ab6222 100644 --- a/web/src/lib/components/table.svelte +++ b/web/src/lib/components/table.svelte @@ -27,7 +27,8 @@ }[keyof T]; export type Style = 'highlight'; - export type StyleFn = (key: keyof T, row?: T) => Style[]; + export type StyleTarget = { key: keyof T; row?: T }; + export type StyleFn = (target: StyleTarget) => Style[]; export type TableProps = { columns: Column[]; @@ -89,7 +90,7 @@ {#each sizedColumns as { column: c, sizing: s } (c.key)} - {@const styles = style?.(c.key) ?? []} + {@const styles = style?.({ key: c.key }) ?? []} {#each sizedColumns as { column: c, sizing: s } (c.key)} - {@const styles = style?.(c.key, d) ?? []} + {@const styles = style?.({ key: c.key, row: d }) ?? []} Scheduled transactions | Expenses - (row?.checked ? ['highlight'] : [])}> +
(row?.checked ? ['highlight'] : [])}> {#snippet header({ key, label })} {#if key === 'checked'}