'use client' import React, { useState } from 'react'; import { Calendar, Clock, User, Mail, Users } from 'lucide-react'; const BookingInterface = () => { const [selectedDate, setSelectedDate] = useState(''); const [selectedTimeSlot, setSelectedTimeSlot] = useState(''); const [selectedBookingType, setSelectedBookingType] = useState(''); const [customerName, setCustomerName] = useState(''); const [customerEmail, setCustomerEmail] = useState(''); const [participantsCount, setParticipantsCount] = useState(1); // Mock data - will be replaced with API calls const bookingTypes = [ { id: '1', name: 'wheel_rental', display_name: 'Wheel Rental', requires_payment: false, price_per_person: 0 }, { id: '2', name: 'hand_building', display_name: 'Hand Building Coworking', requires_payment: false, price_per_person: 0 }, { id: '3', name: 'personal_workshop', display_name: 'Personal Workshop', requires_payment: true, price_per_person: 75 }, { id: '4', name: 'group_workshop', display_name: 'Group Workshop', requires_payment: true, price_per_person: 50 } ]; // Mock available time slots const timeSlots = [ { id: '1', start_time: '09:00', end_time: '11:00', available: true }, { id: '2', start_time: '11:30', end_time: '13:30', available: true }, { id: '3', start_time: '14:00', end_time: '16:00', available: false }, { id: '4', start_time: '16:30', end_time: '18:30', available: true }, { id: '5', start_time: '19:00', end_time: '21:00', available: true } ]; const selectedBookingTypeData = bookingTypes.find(bt => bt.id === selectedBookingType); const handleSubmit = () => { console.log({ selectedBookingType, selectedDate, selectedTimeSlot, customerName, customerEmail, participantsCount }); }; const generateCalendarDays = () => { const today = new Date(); const days = []; for (let i = 0; i < 14; i++) { const date = new Date(today); date.setDate(today.getDate() + i); days.push({ date: date.toISOString().split('T')[0], day: date.getDate(), month: date.toLocaleDateString('en', { month: 'short' }), dayName: date.toLocaleDateString('en', { weekday: 'short' }) }); } return days; }; const calendarDays = generateCalendarDays(); return (
{/* Header */}

Book Your Session

Choose your pottery experience

{/* Booking Type Selection */}

Select Experience

{bookingTypes.map((type) => ( ))}
{/* Date Selection */} {selectedBookingType && (

Choose Date

{calendarDays.map((day) => ( ))}
)} {/* Time Slot Selection */} {selectedDate && (

Available Times

{timeSlots.map((slot) => ( ))}
)} {/* Customer Details */} {selectedTimeSlot && (

Your Details

setCustomerName(e.target.value)} className="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder="Enter your full name" />
setCustomerEmail(e.target.value)} className="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder="Enter your email" />
)} {/* Summary & Submit */} {selectedTimeSlot && customerName && customerEmail && (

Booking Summary

Experience: {selectedBookingTypeData?.display_name}
Date: {selectedDate}
Time: {timeSlots.find(s => s.id === selectedTimeSlot)?.start_time} - {timeSlots.find(s => s.id === selectedTimeSlot)?.end_time}
Participants: {participantsCount}
{selectedBookingTypeData?.requires_payment && (
Total: ${selectedBookingTypeData.price_per_person * participantsCount}
)}
)}
); }; export default BookingInterface;