"use client"; import { useState, useCallback } from "react"; import { BookingCalendar, SelectedSlot } from "@/components/bookings/booking-calendar"; import { BookingDialog } from "@/components/bookings/booking-dialog"; export default function BookingsPage() { const [selectedSlot, setSelectedSlot] = useState(null); const [refreshKey, setRefreshKey] = useState(0); const handleSlotClick = useCallback((slot: SelectedSlot) => { setSelectedSlot(slot); }, []); const handleCloseDialog = useCallback(() => { setSelectedSlot(null); }, []); const handleBookingCreated = useCallback(() => { // Refresh the calendar after booking creation setRefreshKey((prev) => prev + 1); }, []); const handleBookingCancelled = useCallback(() => { // Refresh the calendar after booking cancellation setRefreshKey((prev) => prev + 1); }, []); return (

Reservas

Gestiona las reservas de canchas. Selecciona un horario para crear o ver una reserva.

{selectedSlot && ( )}
); }