import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { CalendarHeader, CalendarWeekDays, CalendarWeekHeader } from "components/issues"; // ui import { Spinner } from "@plane/ui"; // types import { ICalendarWeek } from "./types"; import { IIssueGroupedStructure } from "store/issue"; type Props = { issues: IIssueGroupedStructure | null; layout: "month" | "week" | undefined; }; export const CalendarChart: React.FC = observer((props) => { const { issues, layout } = props; const { calendar: calendarStore } = useMobxStore(); const calendarPayload = calendarStore.calendarPayload; const allWeeksOfActiveMonth = calendarStore.allWeeksOfActiveMonth; if (!calendarPayload) return (
); return ( <>
{layout === "month" ? (
{allWeeksOfActiveMonth && Object.values(allWeeksOfActiveMonth).map((week: ICalendarWeek, weekIndex) => ( ))}
) : ( )}
); });