--- import Admin from '../../layouts/Admin.astro'; import { dashboard, formatPrice } from '../../lib/store.js'; const d = dashboard(); const statusMap = { fulfilled: ['green', 'Erfüllt'], pending: ['amber', 'Offen'], cancelled: ['gray', 'Storniert'], refunded: ['red', 'Erstattet'] }; const fmtDate = (s) => new Date(s).toLocaleDateString('de-DE', { day: '2-digit', month: 'short', year: 'numeric' }); const kpis = [ { label: 'Umsatz (gesamt)', val: formatPrice(d.revenueCents), sub: `${d.orderCount} Bestellungen` }, { label: 'Bestellungen', val: d.orderCount, sub: `${d.pending} offen` }, { label: 'Produkte', val: d.productCount, sub: 'aktiv im Shop' }, { label: 'Kunden', val: d.customerCount, sub: 'registriert' }, ]; --- + Produkt
{kpis.map((k) => (
{k.label}
{k.val}
{k.sub}
))}
First-Party-Funnel (30 Tage)Details
{d.funnelMini.views}
Aufrufe
{d.funnelMini.cart}
In den Korb
{d.funnelMini.buy}
Kauf
Neueste BestellungenAlle
{d.recentOrders.map((o) => ( ))}
BestellungKundeStatusBetrag
{o.number}
{fmtDate(o.created_at)}
{o.customer_name || '—'} {(statusMap[o.status]||['',o.status])[1]} {formatPrice(o.total_cents)}
Geringer Bestand
{d.lowStock.length === 0 ? () : d.lowStock.map((p) => ( ))}
ProduktBestand
Alles gut bestückt 👍
{p.cardImage && }{p.shortName || p.name}
{p.stock}