diff --git a/src/pages/CalendarPage.tsx b/src/pages/CalendarPage.tsx index 3cedc8e..358b62a 100644 --- a/src/pages/CalendarPage.tsx +++ b/src/pages/CalendarPage.tsx @@ -4,7 +4,7 @@ import { supabase } from "@/integrations/supabase/client"; import { useAuth } from "@/contexts/AuthContext"; import { useToast } from "@/hooks/use-toast"; import { useGoogleDrive } from "@/hooks/useGoogleDrive"; -import { Calendar as CalIcon, Plus, ChevronLeft, ChevronRight, Lock, Clock, MoreHorizontal, Edit, Trash2, Download, Loader2, Shield, Eye, EyeOff, Users, Building2, RefreshCw, HardDrive, ListChecks, Search } from "lucide-react"; +import { Calendar as CalIcon, Plus, ChevronLeft, ChevronRight, Lock, Clock, MoreHorizontal, Edit, Trash2, Download, Loader2, Shield, Eye, EyeOff, Users, Building2, RefreshCw, HardDrive, ListChecks, Search, Settings2 } from "lucide-react"; import { Switch } from "@/components/ui/switch"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -14,6 +14,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DialogD import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import AmenitiesManager from "@/components/association/AmenitiesManager"; import { Checkbox } from "@/components/ui/checkbox"; import { fetchAndParseCalendar, validateCalendarUrl } from "@/lib/calendarImportUtils"; import { @@ -201,6 +202,10 @@ export default function CalendarPage({ boardAssociationIds }: { boardAssociation const [manageSelected, setManageSelected] = useState>(new Set()); const [bulkDeleting, setBulkDeleting] = useState(false); const [bookingAmenities, setBookingAmenities] = useState([]); + + // Manage rental/meeting calendars (configure + bookings + block dates) from the dashboard + const [manageCalOpen, setManageCalOpen] = useState(false); + const [manageCalAssocId, setManageCalAssocId] = useState(""); const [recurrence, setRecurrence] = useState(defaultRecurrence); const isBoardView = !!boardAssociationIds?.length; @@ -694,6 +699,11 @@ export default function CalendarPage({ boardAssociationIds }: { boardAssociation + {calendarMode !== "events" && ( + + )} )} @@ -1289,6 +1299,33 @@ export default function CalendarPage({ boardAssociationIds }: { boardAssociation {/* Block Date Dialog */} + {/* Manage rental/meeting calendars: configure amenities, manage bookings, block availability */} + + + + Manage {calendarMode === "meetings" ? "Meeting" : "Rental"} Calendars + + Create or edit calendars, manage their bookings, and block availability — without leaving the calendar. + + +
+
+ + +
+ {manageCalAssocId + ? + :

Select an association to manage its calendars.

} +
+ + + +
+
+ Block Date