Calendar code re-organization, event CRUD (except for Update).

This commit is contained in:
Bruno Bernardino
2024-03-20 20:21:20 +00:00
parent eff6a08771
commit f779dde0fc
13 changed files with 1844 additions and 1174 deletions

View File

@@ -0,0 +1,23 @@
import { Calendar, CalendarEvent } from '/lib/types.ts';
import MainCalendar from '/components/calendar/MainCalendar.tsx';
interface CalendarWrapperProps {
initialCalendars: Pick<Calendar, 'id' | 'name' | 'color' | 'is_visible'>[];
initialCalendarEvents: CalendarEvent[];
view: 'day' | 'week' | 'month';
startDate: string;
}
// This wrapper is necessary because islands need to be the first frontend component, but they don't support functions as props, so the more complex logic needs to live in the component itself
export default function CalendarWrapper(
{ initialCalendars, initialCalendarEvents, view, startDate }: CalendarWrapperProps,
) {
return (
<MainCalendar
initialCalendars={initialCalendars}
initialCalendarEvents={initialCalendarEvents}
view={view}
startDate={startDate}
/>
);
}