import type { Metadata } from "next";
import { getCurrentCustomer } from "@/lib/auth/customer";
import { getCustomerBookings } from "@/lib/booking/queries";
import { PersonalCalendar } from "@/components/booking/PersonalCalendar";

export const metadata: Metadata = { title: "Mein Kalender" };

export default async function KontoKalenderPage() {
  const customer = await getCurrentCustomer();
  if (!customer) return null;

  const bookings = await getCustomerBookings(customer.id);

  return (
    <div>
      <h2 className="font-serif text-xl font-medium text-anouma-plum">Mein Kalender</h2>
      <div className="mt-6">
        <PersonalCalendar bookings={bookings} />
      </div>
    </div>
  );
}
