This commit is contained in:
cdricms
2025-02-18 12:59:54 +01:00
parent 4e671974d2
commit ec3f33b9bf
3 changed files with 50 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
"use client";
import Planning from "@/components/planning";
import { useApi } from "@/hooks/use-api";
import ICalendarEvent from "@/interfaces/ICalendarEvent";
import { Loader2 } from "lucide-react";
export default function Page() {
const {
data: requestedEvents,
isLoading,
success,
mutate,
} = useApi<ICalendarEvent[]>("/events", undefined, false, false);
if (isLoading) return <Loader2 className="animate-spin" />;
if (success)
return (
<Planning
modifiable
events={requestedEvents ?? []}
mutate={mutate}
/>
);
}