fix: reactive mutable page.ts data now is $state

This commit is contained in:
James Xylight committed 2024-12-28 12:30:24 -08:00
1 parent f390e6b844
commit f6214b6640
4 files changed
+29 -19

No files matched your search

+18 -15
View File
@@ -18,6 +18,8 @@
import Header from '$lib/components/ui/layout/pages/Header.svelte'
let { data = $bindable() } = $props()
let reports = $state(data.items)
</script>
<div class="mb-4 flex flex-col gap-4">
@@ -29,7 +31,7 @@
bind:value={data.type}
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
>
{#snippet label()}
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={Funnel} size="15" mini />
{$t('filter.filter')}
@@ -46,22 +48,23 @@
{/snippet}
</Header>
</div>
{#if data.items && data.items.length > 0}
{#if reports && reports.length > 0}
<div class="flex flex-col gap-4">
{#each data.items as item}
<div in:fly={{ y: -6, opacity: 0, duration: 500 }}>
<Material class="flex flex-col gap-4 text-sm">
<div class="flex flex-col gap-1.5">
<span class="text-xs font-bold dark:text-zinc-400 text-slate-600">
Report from
</span>
<span class="font-bold">
<UserLink avatar user={item.creator} />
</span>
</div>
{#each reports as item}
<div
in:fly={{ y: -6, opacity: 0, duration: 500 }}
class="flex flex-col gap-1 text-sm"
>
<div class="flex flex-col gap-1.5">
<span class="text-xs font-bold dark:text-zinc-400 text-slate-600">
Report from
</span>
<span class="font-bold">
<UserLink avatar user={item.creator} />
</span>
</div>
<Report {item} />
</Material>
<Report {item} />
</div>
{/each}
</div>
+2
View File
@@ -138,6 +138,8 @@
: ''}"
loading={resolving}
disabled={resolving}
rounding="pill"
color="ghost"
>
{#snippet prefix()}
<Icon src={CheckCircle} micro={item.resolved} size="18" />