import { useTranslation } from "react-i18next"; import isDefined from "../../../../Core/isDefined"; import type { ObjectifiedMonths } from "../../../../ModelMixins/DiscretelyTimeVaryingMixin"; import * as DTP from "./DateTimePickerStyles"; import { daysInMonth, monthNames } from "./utils"; interface MonthViewProps { year: number; datesObject: ObjectifiedMonths; onSelectMonth: (month: number) => void; onBack: () => void; } export const MonthView: React.FC = ({ year, datesObject, onSelectMonth, onBack }) => { const { t } = useTranslation(); if (!datesObject.dates || datesObject.dates.length <= 12) { return null; } return ( {year} {monthNames.map((m, i) => ( isDefined(datesObject[i]) && onSelectMonth(i)} > {m} {daysInMonth(i + 1, year).map((d) => ( ))} ))} ); };