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 "components/ui"; // types import { ICalendarWeek } from "./types"; import { IIssueGroupedStructure } from "store/issue"; type Props = { issues: IIssueGroupedStructure | null; }; export const CalendarChart: React.FC = observer((props) => { const { issues } = props; const { calendar: calendarStore, issueFilter: issueFilterStore } = useMobxStore(); const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; const calendarPayload = calendarStore.calendarPayload; const allWeeksOfActiveMonth = calendarStore.allWeeksOfActiveMonth; if (!calendarPayload) return (
); return ( <>
{calendarLayout === "month" ? (
{allWeeksOfActiveMonth && Object.values(allWeeksOfActiveMonth).map((week: ICalendarWeek, weekIndex) => ( ))}
) : ( )}
); });