added chart

This commit is contained in:
2026-06-17 16:46:40 +02:00
parent 7a90ced98e
commit f4e357a8a1
2 changed files with 283 additions and 11 deletions
+2 -11
View File
@@ -3,6 +3,7 @@
import { page } from '$app/state';
import { ApiError } from '$lib/api';
import { auth } from '$lib/auth.svelte';
import PriceChart from '$lib/PriceChart.svelte';
import {
lists,
listsApi,
@@ -403,18 +404,8 @@
<div class="border-t border-smoke pt-3">
{#if historyLoading}
<p class="text-xs text-mute flicker">loading history…</p>
{:else if history.length === 0}
<p class="text-xs text-mute">no price checks yet — hit refresh to start tracking.</p>
{:else}
<ul class="space-y-1 text-xs">
{#each history as h}
<li class="flex items-center justify-between gap-3">
<span class="text-ink">{money(h.price, h.currency)}</span>
{#if h.in_stock === false}<span class="text-rose">sold out</span>{/if}
<span class="text-mute">{fmtDate(h.fetched_at)}</span>
</li>
{/each}
</ul>
<PriceChart {history} target={item.target_price} currency={item.currency} />
{/if}
</div>
{/if}