const VenuesView = ({ selectedProperty }) => { const { useState, useEffect, useRef } = React; const [venues, setVenues] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { if (selectedProperty) { loadVenues(); } }, [selectedProperty]); const loadVenues = async () => { if (!selectedProperty) { setLoading(false); return; } try { const res = await fetch(`/api/properties/${selectedProperty.property_code}/venues`); if (res.ok) { const data = await res.json(); setVenues(data.venues || []); } } catch (error) { console.error('Failed to load venues:', error); } finally { setLoading(false); } }; if (loading) { return (
); } if (!selectedProperty) { return (
🏨

Select a Property

Choose a property from the dropdown to view venues

); } return (

Venues

{selectedProperty.name}

{venues.length === 0 ? (
🏨

No venues found

This property doesn't have any venues configured yet

) : (
{venues.map((venue) => (

{venue.name}

{venue.type}
{venue.restaurant_name && (

Restaurant: {venue.restaurant_name}

)} {venue.description && (

{venue.description}

)} {venue.location && (

📍 {venue.location}

)} {venue.capacity && (

👥 Capacity: {venue.capacity}

)}
))}
)}
); }; if (typeof window !== 'undefined') window.VenuesView = VenuesView; // ═══════════════════════════════════════════════════════════════════════════ // ADMINISTRATION VIEW COMPONENT // ═══════════════════════════════════════════════════════════════════════════