21 lines
548 B
TypeScript
21 lines
548 B
TypeScript
"use client";
|
|
import Planning from "@/components/planning.tsx";
|
|
import { useApi } from "@/hooks/use-api";
|
|
import { type CalendarEventExternal } from "@schedule-x/calendar";
|
|
import { Loader2 } from "lucide-react";
|
|
|
|
const Page = () => {
|
|
const {
|
|
data: requestedEvents,
|
|
isLoading,
|
|
success,
|
|
mutate,
|
|
} = useApi<CalendarEventExternal[]>("/events", undefined, false, false);
|
|
|
|
if (isLoading) return <Loader2 className="animate-spin" />;
|
|
if (success)
|
|
return <Planning events={requestedEvents ?? []} mutate={mutate} />;
|
|
};
|
|
|
|
export default Page;
|