From ba34a3eb8e3e9fa4648442ac67fcada880f8f7b8 Mon Sep 17 00:00:00 2001 From: Arthur Bassi Date: Tue, 16 Jun 2026 09:15:03 -0300 Subject: [PATCH] chore(calendar): disable routes until backend exists --- .../_components/calendar-unavailable.tsx | 22 +++++++ src/app/(protected)/calendar/_layout.tsx | 12 +++- src/app/(protected)/calendar/edit/[id].tsx | 2 +- src/app/(protected)/calendar/index.tsx | 60 +------------------ src/app/(protected)/calendar/new.tsx | 2 +- 5 files changed, 35 insertions(+), 63 deletions(-) create mode 100644 src/app/(protected)/calendar/_components/calendar-unavailable.tsx diff --git a/src/app/(protected)/calendar/_components/calendar-unavailable.tsx b/src/app/(protected)/calendar/_components/calendar-unavailable.tsx new file mode 100644 index 00000000..d9ef6baf --- /dev/null +++ b/src/app/(protected)/calendar/_components/calendar-unavailable.tsx @@ -0,0 +1,22 @@ +import { Alert, Box, Typography } from "@mui/material"; + +export function CalendarUnavailablePanel() { + return ( + + + Calendário indisponível — a API de calendário ainda não está implementada no backend. + + + As rotas permanecem reservadas para quando o CalendarController for disponibilizado. + + + ); +} + +export default function CalendarUnavailablePage() { + return ( + + + + ); +} diff --git a/src/app/(protected)/calendar/_layout.tsx b/src/app/(protected)/calendar/_layout.tsx index a7f9468b..01b55019 100644 --- a/src/app/(protected)/calendar/_layout.tsx +++ b/src/app/(protected)/calendar/_layout.tsx @@ -1,5 +1,13 @@ -import { Navigate } from "react-router-dom"; +import { Outlet } from "react-router-dom"; +import { Alert, Box } from "@mui/material"; export default function CalendarLayout() { - return ; + return ( + + + Calendário indisponível — a API de calendário ainda não está implementada no backend. + + + + ); } diff --git a/src/app/(protected)/calendar/edit/[id].tsx b/src/app/(protected)/calendar/edit/[id].tsx index 751eb3ca..98c47fcd 100644 --- a/src/app/(protected)/calendar/edit/[id].tsx +++ b/src/app/(protected)/calendar/edit/[id].tsx @@ -1 +1 @@ -export { default } from "../_components/event-form"; +export { default } from "../_components/calendar-unavailable"; diff --git a/src/app/(protected)/calendar/index.tsx b/src/app/(protected)/calendar/index.tsx index 93da0024..be1a4079 100644 --- a/src/app/(protected)/calendar/index.tsx +++ b/src/app/(protected)/calendar/index.tsx @@ -1,59 +1 @@ -import { useMemo, useRef, useState } from "react"; -import { useNavigate } from "react-router-dom"; -import type { DatesSetArg, EventClickArg } from "@fullcalendar/core"; -import type { DateClickArg } from "@fullcalendar/interaction"; -import FullCalendar from "@fullcalendar/react"; -import { Box } from "@mui/material"; -import { CalendarActionBar } from "@/components/common/calendar/calendar-action-bar"; -import { EventCalendar } from "@/components/common/calendar/event-calendar"; -import { mapEventToFullCalendar } from "@/components/common/calendar/calendar-utils"; -import { useCalendarEvents } from "@/domain/calendar/use-cases/use-calendar-events"; - -export default function CalendarPage() { - const navigate = useNavigate(); - const calendarRef = useRef(null); - const [range, setRange] = useState<{ start: Date; end: Date } | null>(null); - const [title, setTitle] = useState(""); - - const { data: events = [], isFetching } = useCalendarEvents( - range?.start ?? null, - range?.end ?? null, - ); - - const fullCalendarEvents = useMemo(() => events.map(mapEventToFullCalendar), [events]); - - const handleDatesSet = (info: DatesSetArg) => { - setRange({ start: info.start, end: info.end }); - setTitle(info.view.title); - }; - - const handleEventClick = (clickInfo: EventClickArg) => { - navigate(`/calendar/edit/${clickInfo.event.id}`); - }; - - const handleDateClick = (dateInfo: DateClickArg) => { - navigate(`/calendar/new?date=${dateInfo.dateStr}`); - }; - - const calendarApi = () => calendarRef.current?.getApi(); - - return ( - - calendarApi()?.today()} - onPrevClick={() => calendarApi()?.prev()} - onNextClick={() => calendarApi()?.next()} - onViewChange={(view) => calendarApi()?.changeView(view)} - /> - - - ); -} +export { default } from "./_components/calendar-unavailable"; diff --git a/src/app/(protected)/calendar/new.tsx b/src/app/(protected)/calendar/new.tsx index 1aef5075..be1a4079 100644 --- a/src/app/(protected)/calendar/new.tsx +++ b/src/app/(protected)/calendar/new.tsx @@ -1 +1 @@ -export { default } from "./_components/event-form"; +export { default } from "./_components/calendar-unavailable";