diff --git a/.phase47-state.json b/.phase47-state.json index d85786f..c8a5174 100644 --- a/.phase47-state.json +++ b/.phase47-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "order-summary-component", + "current_feature": "calendar-month-grid-component", "started_at": "2026-05-23T10:53:28.415380", "attempted_features": [ - "receipt-component" + "receipt-component", + "order-summary-component" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 03547b5..82f31b5 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -4782,3 +4782,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, +- `10:53:58` **INFO** Committed feature order-summary-component +- `10:53:59` **INFO** Pushed: rc=0 + +## Phase-3 Feature: calendar-month-grid-component (2026-05-23 10:53:59) + +- `10:53:59` **INFO** Description: MonthGrid (read-only Display-Komponente) +- `10:53:59` **INFO** Generating apps/web/src/components/CalendarMonthGrid.tsx (CalendarMonthGrid-Component. Props: year, month (0-11), highlightDates…) +- `10:54:16` **INFO** wrote 2364 chars in 17.5s (attempt 1) +- `10:54:16` **INFO** Running tsc --noEmit on api… +- `10:54:18` **WARN** tsc errors: +src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(45,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/db/schema.ts(49,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(53,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/web/src/components/CalendarMonthGrid.tsx b/apps/web/src/components/CalendarMonthGrid.tsx new file mode 100644 index 0000000..7fcd4ce --- /dev/null +++ b/apps/web/src/components/CalendarMonthGrid.tsx @@ -0,0 +1,71 @@ +import React, { useMemo } from 'react'; +import { format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, eachDayOfInterval, isSameDay, isToday } from 'date-fns'; +import { de } from 'date-fns/locale'; + +interface CalendarMonthGridProps { + year: number; + month: number; // 0-11 + highlightDates?: Date[]; + onDayClick?: (date: Date) => void; +} + +const CalendarMonthGrid: React.FC = ({ + year, + month, + highlightDates = [], + onDayClick, +}) => { + const days = useMemo(() => { + const monthStart = new Date(year, month, 1); + const monthEnd = new Date(year, month + 1, 0); + const startDate = startOfWeek(monthStart, { weekStartsOn: 1 }); + const endDate = endOfWeek(monthEnd, { weekStartsOn: 1 }); + + return eachDayOfInterval({ + start: startDate, + end: endDate, + }); + }, [year, month]); + + const dayNames = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So']; + + return ( +
+
+ {dayNames.map((day) => ( +
+ {day} +
+ ))} +
+
+ {days.map((date, idx) => { + const isCurrentMonth = date.getMonth() === month; + const isHighlighted = highlightDates.some((hd) => isSameDay(hd, date)); + const isTodayDate = isToday(date); + + return ( + + ); + })} +
+
+ ); +}; + +export default CalendarMonthGrid; \ No newline at end of file