import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { CalendarDayTile } from "components/issues"; // helpers import { renderDateFormat } from "helpers/date-time.helper"; // types import { ICalendarDate, ICalendarWeek } from "./types"; import { IIssueGroupedStructure } from "store/issue"; import { IIssue } from "types"; type Props = { issues: IIssueGroupedStructure | null; week: ICalendarWeek | undefined; handleIssues: (date: string, issue: IIssue, action: "update" | "delete") => void; quickActions: (issue: IIssue) => React.ReactNode; enableQuickIssueCreate?: boolean; }; export const CalendarWeekDays: React.FC = observer((props) => { const { issues, week, handleIssues, quickActions, enableQuickIssueCreate } = props; const { issueFilter: issueFilterStore } = useMobxStore(); const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; const showWeekends = issueFilterStore.userDisplayFilters.calendar?.show_weekends ?? false; if (!week) return null; return (
{Object.values(week).map((date: ICalendarDate) => { if (!showWeekends && (date.date.getDay() === 0 || date.date.getDay() === 6)) return null; return ( ); })}
); });