import type { Metadata } from "next"; import { CheckoutContent } from "./components/CheckoutContent"; import { TrustRow } from "../components/TrustRow"; import { Footer } from "../components/Footer"; import { getShippingMethods, getPaymentMethods, getCartTrustBadges, getShippingSettings, getDefaultTaxRatePercent } from "../lib/payload"; import { getSessionCustomer, getCustomerProfile } from "../lib/customerAuth"; // robots: noindex — transactional page, same reasoning as /cart. export const metadata: Metadata = { title: "Checkout", description: "Schließe deine Bestellung bei einfach produktiv ab.", robots: { index: false, follow: true, }, }; export default async function CheckoutPage() { const [shippingMethods, paymentMethods, trustBadges, shippingSettings, defaultTaxRate, session] = await Promise.all([ getShippingMethods(), getPaymentMethods(), getCartTrustBadges(), getShippingSettings(), getDefaultTaxRatePercent(), getSessionCustomer(), ]); // Full profile (incl. saved address) only fetched when a session exists // — pre-fills Card 1 for a returning customer instead of leaving it blank. const profile = session ? await getCustomerProfile(session.token) : null; return ( <>