Refactor data-table component to use let for options and table variables

This commit is contained in:
2026-02-09 12:00:47 -06:00
parent 24c59bb2b3
commit 4daa66aa9d
2 changed files with 4 additions and 3 deletions

View File

@@ -103,6 +103,7 @@
</thead>
<tbody>
{#each filteredItems as item}
{@const Icon = getCategoryIcon(item.type)}
<tr class="border-b hover:bg-muted/50 transition-colors">
<td class="p-3 font-mono font-bold text-primary">{item.key}</td>
@@ -110,7 +111,7 @@
<td class="p-3">
<div class="flex items-center gap-1 text-xs text-muted-foreground">
<svelte:component this={getCategoryIcon(item.type)} class="h-3 w-3" />
<Icon class="h-3 w-3" />
{item.type}
</div>
</td>

View File

@@ -21,7 +21,7 @@
let scrollContainer: HTMLDivElement;
let observer: IntersectionObserver;
const options = $derived<TableOptions<TData>>({
let options = $derived<TableOptions<TData>>({
get data() {
return data;
},
@@ -29,7 +29,7 @@
getCoreRowModel: getCoreRowModel()
});
const table = createSvelteTable(options);
let table = $derived(createSvelteTable(options));
onMount(() => {
if (!loadMore) return;