import React from "react";

import { DateClickArg, EventClickArg } from "@fullcalendar/react";
import { Dayjs } from "dayjs";
import { EventContentArg } from "@fullcalendar/core";

type ViewOption = {
  label: string;
  fullCalendarView: string;
  picker: string;
  default?: boolean;
};

type ViewOptionsType = {
  [key: string]: ViewOption;
};

interface EventObject {
  title: string;
  start: Date;
  [key: string]: any;
}

const CalendarView: React.FC<{
  viewOptions?: ViewOptionsType;
  events?: EventObject[];
  handleDateClick?: (info: DateClickArg) => void;
  handleEventClick?: (info: EventClickArg) => void;
  onDateChange?: (date: Dayjs) => void;
  eventClassNames?: string | ((arg: EventContentArg) => string);
  eventContent?: (arg: EventContentArg) => void;
  dayCellClassNames?: string | ((arg: any) => string);
  dayMaxEvents?: number;
  eventMaxStack?: number;
  validDates?: { start: Dayjs | Date | null; end: Dayjs | Date | null };
  hideHeader?: boolean;
  locale?: string;
}>;

export default CalendarView;
