import type { Metadata } from "next"; import { LegalPage } from "@/components/legal-page"; import { getShippingTiers, getShippingRegion } from "@/lib/shipping"; import { formatPrice } from "@/lib/format"; import { getLocale } from "@/i18n/locale"; import { getDictionary } from "@/i18n/get-dictionary"; export const metadata: Metadata = { title: "Versand und Zahlung", alternates: { canonical: "/versand-zahlung" } }; // Versandstaffeln koennen sich im Admin-Bereich jederzeit aendern — diese // Seite muss die aktuellen Werte zeigen statt eines eingefrorenen Build-Stands. export const dynamic = "force-dynamic"; export default async function VersandZahlungPage() { const locale = await getLocale(); const t = getDictionary(locale); const [tiers, region] = await Promise.all([getShippingTiers(), getShippingRegion()]); const tierParagraphs = tiers.length > 0 ? tiers.map((tier) => tier.maxQuantity === null ? t.versandZahlungPage.tierMinimum(tier.minQuantity, formatPrice(tier.priceCents, "EUR", locale)) : t.versandZahlungPage.tierRange( tier.minQuantity, tier.maxQuantity, formatPrice(tier.priceCents, "EUR", locale) ) ) // Ohne gepflegte Versandstaffel bleibt die Liste leer, statt einen // Ersatzsatz zu zeigen — so aendert sich der Abschnitt nur, wenn // tatsaechlich Staffeln hinterlegt sind. : []; return ( ); }