--- import Layout from "../../../layouts/Layout.astro"; import ProductCard from "../../../components/ProductCard.astro"; import { products, getProduct } from "../../../data/products"; import type { Locale } from "../../../i18n/config"; import { useTranslations } from "../../../i18n/ui"; import { formatPrice } from "../../../i18n/format"; const lang: Locale = "en"; const t = useTranslations(lang); // Bestellungen sind weiterhin Beispieldaten (siehe previewNote) — ECHT sind ab jetzt aber // Anmeldung, Profil (Benutzername/Foto) und Rezensionen, gespeichert im localStorage dieses // Geräts (siehe scripts/account.ts, scripts/reviews.ts). Jede Bestellposition referenziert // einen echten Produkt-Slug — der Name kommt live aus den Produktdaten (mehrsprachig, immer // konsistent mit dem Shop), damit "Rezension schreiben" wirklich zur passenden Seite führt. const beispielBestellungenRoh = [ { nummer: "VDB-2026-0184", datum: "28.07.2026", status: "versendet" as const, tracking: "00340434161094015791", artikel: [ { slug: "hasidog-plushie-blaueroverall", menge: 1 }, { slug: "perlen-armband-hellblau", menge: 1 }, ], }, { nummer: "VDB-2026-0157", datum: "12.07.2026", status: "abgeschlossen" as const, tracking: null, artikel: [{ slug: "haekelnadel-set-ergonomisch", menge: 1 }], }, ]; const beispielBestellungen = beispielBestellungenRoh.map((b) => { const artikel = b.artikel.map((a) => { const p = getProduct(a.slug); return { ...a, name: p?.name[lang] ?? a.slug, preis: p?.preis ?? 0 }; }); return { ...b, artikel, summe: artikel.reduce((s, a) => s + a.preis * a.menge, 0) }; }); const statusLabel = { bezahlt: t.accountDash.statusBezahlt, bearbeitung: t.accountDash.statusBearbeitung, versandVorbereitet: t.accountDash.statusVersandVorbereitet, versendet: t.accountDash.statusVersendet, abgeschlossen: t.accountDash.statusAbgeschlossen, } as const; // "Zuletzt angesehen" zeigt in dieser Vorschau einfach die ersten echten Produkte aus dem Shop — // in Phase 2 kommt hier die tatsächliche Verlaufs-Historie der angemeldeten Person hin. const zuletztAngesehen = products.slice(0, 3); const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versendet").length; --- {t.accountDash.notLoggedIn} {t.accountDash.previewNote} {t.accountDash.eyebrow} {t.accountDash.greeting("…")} {t.accountDash.lead} {t.accountDash.logout} {beispielBestellungen.length} {t.accountDash.statOrders} 0 {t.accountDash.statWishlist} {offeneSendungen} {t.accountDash.statOpen} {t.accountDash.ordersTitle} {beispielBestellungen.map((b) => ( {t.accountDash.orderNo} {b.nummer} {t.accountDash.orderDate} {b.datum} {statusLabel[b.status]} {b.artikel.map((a) => ( {a.menge}× {a.name} {formatPrice(a.preis * a.menge, lang)} {/* Zustand (Button vs. "✓ Bewertet") hängt vom localStorage ab — wird per JS beim Laden gesetzt (siehe Script unten), Grundzustand ist der Button. */} {t.accountDash.reviewBtn} ))} {t.accountDash.orderTotal}: {formatPrice(b.summe, lang)} {b.tracking && {t.accountDash.trackingBtn}} {t.accountDash.invoiceBtn} {t.accountDash.reorderBtn} {b.tracking && ( {t.accountDash.trackingLabel}: {b.tracking} )} ))} {t.accountDash.wishlistTitle} {t.accountDash.wishlistEmpty} {zuletztAngesehen.length > 0 && ( {t.accountDash.recentTitle} {zuletztAngesehen.map((p) => )} )} {t.accountDash.profileTitle} {t.accountDash.photoLabel} {t.accountDash.photoChange} {t.accountDash.photoRemove} {t.accountDash.usernameLabel} {t.accountDash.usernameSave} {t.accountDash.usernameSaved} {t.accountDash.profileEmail}– {t.accountDash.profileAddress}Musterstraße 110115 BerlinDeutschland
{t.accountDash.notLoggedIn}
{t.accountDash.previewNote}
{t.accountDash.lead}
{t.accountDash.trackingLabel}: {b.tracking}
{b.tracking}
{t.accountDash.wishlistEmpty}