34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { getCurrentCustomer } from "@/lib/auth/customer";
|
|
import { getCustomerBookings } from "@/lib/booking/queries";
|
|
import { BookingCard } from "@/components/booking/BookingCard";
|
|
import { getMeetingSettingsGlobal } from "@/lib/payload/globals";
|
|
import { getBookingMeetingStatus } from "@/lib/booking/meetingAccess";
|
|
|
|
export const metadata: Metadata = { title: "Meine Termine" };
|
|
|
|
export default async function KontoTerminePage() {
|
|
const customer = await getCurrentCustomer();
|
|
if (!customer) return null;
|
|
|
|
const bookings = await getCustomerBookings(customer.id);
|
|
const meetingSettings = await getMeetingSettingsGlobal();
|
|
|
|
return (
|
|
<div>
|
|
<h2 className="font-serif text-xl font-medium text-anouma-plum">Meine Termine</h2>
|
|
{bookings.length === 0 ? (
|
|
<p className="mt-3 text-sm text-anouma-plum/70">
|
|
Du hast noch keine Terminanfragen gestellt.
|
|
</p>
|
|
) : (
|
|
<div className="mt-4 grid gap-4 sm:grid-cols-2">
|
|
{bookings.map((b) => (
|
|
<BookingCard key={b.id} booking={b} meetingStatus={getBookingMeetingStatus(b, meetingSettings)} />
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|