import type { Metadata } from "next"; import Link from "next/link"; import { getCurrentCustomer } from "@/lib/auth/customer"; import { getCustomerBookings } from "@/lib/booking/queries"; import { BookingCard } from "@/components/booking/BookingCard"; export const metadata: Metadata = { title: "Mein Konto" }; export default async function KontoOverviewPage() { const customer = await getCurrentCustomer(); if (!customer) return null; // Layout already redirects; keeps TS happy. const bookings = await getCustomerBookings(customer.id); const pending = bookings.filter((b) => b.status === "pending"); const confirmed = bookings.filter((b) => b.status === "confirmed" && new Date(b.date) >= new Date()); const past = bookings.filter((b) => new Date(b.date) < new Date() || b.status === "rejected" || b.status === "cancelled"); return (
Keine offenen Anfragen.
) : (Noch keine bestätigten Termine.
) : (