feat: wire 10 dead buttons across 6 modules to their server actions
Every module had buttons that rendered visually but did nothing when clicked. Server actions existed for all of them. Created client components with dialogs/forms and wired them in. BOOKINGS MODULE: - BookingStatusActions: Check-in/Check-out/Cancel buttons now call updateBookingStatus server action with loading states + toast - CreateRoomDialog: 'Neues Zimmer' opens dialog with room number, name, capacity, price/night fields → calls createRoom - CreateGuestDialog: 'Neuer Gast' opens dialog with first/last name, email, phone fields → calls createGuest COURSES MODULE: - EnrollParticipantDialog: 'Teilnehmer anmelden' on participants page opens dialog with first/last name, email, phone → calls enrollParticipant EVENTS MODULE: - EventRegistrationDialog: 'Anmeldung' button on event detail opens dialog with participant data + DOB → calls registerForEvent - CreateHolidayPassDialog: 'Neuer Ferienpass' opens dialog with name, year, description, price, date range → calls createHolidayPass NEWSLETTER MODULE: - CreateTemplateDialog: 'Neue Vorlage' opens dialog with name, subject, HTML body → calls createTemplate SITE-BUILDER MODULE: - Posts 'Neuer Beitrag' button now links to /posts/new page All dialogs use German labels, helpful placeholders, loading spinners, toast notifications, and form validation appropriate for association board members (Vereinsvorstände, 40-65, moderate tech skills).
This commit is contained in:
@@ -4,13 +4,11 @@ import {
|
||||
ArrowLeft,
|
||||
BedDouble,
|
||||
CalendarDays,
|
||||
LogIn,
|
||||
LogOut,
|
||||
XCircle,
|
||||
User,
|
||||
} from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { BookingStatusActions } from '@kit/booking-management/components';
|
||||
import { formatDate, formatCurrencyAmount } from '@kit/shared/dates';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { Badge } from '@kit/ui/badge';
|
||||
@@ -288,41 +286,10 @@ export default async function BookingDetailPage({ params }: PageProps) {
|
||||
<CardDescription>{t('detail.changeStatus')}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
{(status === 'pending' || status === 'confirmed') && (
|
||||
<Button variant="default">
|
||||
<LogIn className="mr-2 h-4 w-4" />
|
||||
{t('detail.checkIn')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{status === 'checked_in' && (
|
||||
<Button variant="default">
|
||||
<LogOut className="mr-2 h-4 w-4" />
|
||||
{t('detail.checkOut')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{status !== 'cancelled' &&
|
||||
status !== 'checked_out' &&
|
||||
status !== 'no_show' && (
|
||||
<Button variant="destructive">
|
||||
<XCircle className="mr-2 h-4 w-4" />
|
||||
{t('detail.cancel')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{status === 'cancelled' || status === 'checked_out' ? (
|
||||
<p className="text-muted-foreground py-2 text-sm">
|
||||
{t('detail.noMoreActions', {
|
||||
statusLabel:
|
||||
status === 'cancelled'
|
||||
? t('detail.cancelledStatus')
|
||||
: t('detail.completedStatus'),
|
||||
})}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
<BookingStatusActions
|
||||
bookingId={bookingId}
|
||||
status={status}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user