import { UserCircle, Plus } from 'lucide-react'; import { getTranslations } from 'next-intl/server'; import { createBookingManagementApi } from '@kit/booking-management/api'; import { CreateGuestDialog } from '@kit/booking-management/components'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import { Button } from '@kit/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card'; import { AccountNotFound } from '~/components/account-not-found'; import { CmsPageShell } from '~/components/cms-page-shell'; import { EmptyState } from '~/components/empty-state'; interface PageProps { params: Promise<{ account: string }>; } export default async function GuestsPage({ params }: PageProps) { const { account } = await params; const client = getSupabaseServerClient(); const t = await getTranslations('bookings'); const { data: acct } = await client .from('accounts') .select('id') .eq('slug', account) .single(); if (!acct) { return ( ); } const api = createBookingManagementApi(client); const guests = await api.guests.list(acct.id); return (

{t('guests.manage')}

{guests.length === 0 ? ( } title={t('guests.noGuests')} description={t('guests.addFirst')} actionLabel={t('guests.newGuest')} /> ) : ( {t('guests.allGuests', { count: guests.length })}
{guests.map((guest: Record) => ( ))}
{t('guests.name')} {t('guests.email')} {t('guests.phone')} {t('guests.city')} {t('guests.country')}
{String(guest.last_name ?? '')},{' '} {String(guest.first_name ?? '')} {String(guest.email ?? '—')} {String(guest.phone ?? '—')} {String(guest.city ?? '—')} {String(guest.country ?? '—')}
)}
); }