diff --git a/app/vision/page.tsx b/app/vision/page.tsx index a13be64..5d82f3c 100644 --- a/app/vision/page.tsx +++ b/app/vision/page.tsx @@ -7,7 +7,7 @@ import { ResponsiveIframe } from "@/app/components/responsive-iframe"; import { Users, FolderKanban, Video, ArrowLeft, Loader2, Calendar, Clock, Plus, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useToast } from "@/components/ui/use-toast"; -import { CalendarClient } from "@/components/calendar/calendar-client"; +import { Calendar as CalendarComponent } from "@/components/ui/calendar"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; @@ -52,8 +52,6 @@ export default function VisionPage() { const [scheduledMeetings, setScheduledMeetings] = useState([]); const [showMeetingDialog, setShowMeetingDialog] = useState(false); const [selectedDate, setSelectedDate] = useState(new Date()); - const [calendars, setCalendars] = useState([]); - const [calendarsLoading, setCalendarsLoading] = useState(true); const [meetingForm, setMeetingForm] = useState<{ type: "group" | "mission" | ""; entityId: string; @@ -98,32 +96,6 @@ export default function VisionPage() { } }, [scheduledMeetings, session, status]); - // Fetch calendars - useEffect(() => { - const fetchCalendars = async () => { - if (status !== "authenticated" || !session?.user?.id) { - return; - } - - try { - setCalendarsLoading(true); - const response = await fetch("/api/calendars"); - if (response.ok) { - const calendarsData = await response.json(); - setCalendars(Array.isArray(calendarsData) ? calendarsData : []); - } else { - console.error("Failed to fetch calendars"); - } - } catch (error) { - console.error("Error fetching calendars:", error); - } finally { - setCalendarsLoading(false); - } - }; - - fetchCalendars(); - }, [session, status]); - // Fetch user groups and missions useEffect(() => { const fetchData = async () => { @@ -406,75 +378,86 @@ export default function VisionPage() {
- {/* Colonne calendrier (étroite) - CalendarClient avec dimensions réduites */} + {/* Colonne calendrier (étroite) */}
- {calendarsLoading ? ( -
- -
- ) : session?.user?.id ? ( -
-