import { type Component, For } from "solid-js"; import CalendarDay from "@/components/CalendarDay"; import { isFutureDate, isTodayDate } from "@/utils"; import type { DiaryEntry } from "@/api/diary"; interface CalendarGridProps { days: Array<{ day: number | null; isCurrentMonth: boolean; date: Date | null; }>; getEntryForDate: (date: Date | null) => DiaryEntry | undefined; onDayClick: (date: Date | null) => void; isTherapistView?: boolean; } const CalendarGrid: Component = (props) => (
{(dayInfo) => { const entry = props.getEntryForDate(dayInfo.date); const isFuture = isFutureDate(dayInfo.date); const isToday = isTodayDate(dayInfo.date); return ( props.onDayClick(dayInfo.date)} /> ); }}
); export default CalendarGrid;