feat: product detail page with chart, alert list, alert form

This commit is contained in:
2026-05-25 14:35:59 +00:00
parent 04c014d48b
commit 99d1d85293
5 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
'use client'
export function ProductActions({ productId }: { productId: string }) {
async function refresh() {
const res = await fetch(`/api/products/${productId}/scrape`, { method: 'POST' })
if (res.ok) location.reload()
}
async function del() {
if (!confirm('Wirklich löschen?')) return
const res = await fetch(`/api/products/${productId}`, { method: 'DELETE' })
if (res.ok) location.href = '/'
}
return (
<div className="flex gap-2">
<button onClick={refresh} className="rounded bg-zinc-800 px-3 py-1.5 text-sm hover:bg-zinc-700">Jetzt aktualisieren</button>
<button onClick={del} className="rounded bg-red-900 px-3 py-1.5 text-sm hover:bg-red-800">Löschen</button>
</div>
)
}