From fa9cd8971cd9af2dc903785c6590fb77cc4ae667 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 10:08:59 +0200 Subject: [PATCH] feat(rating-component): Rating mit Sternen [tsc:fail] --- .phase38-state.json | 5 ++-- GENERATION_LOG.md | 18 ++++++++++++ apps/web/src/components/Rating.tsx | 46 ++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/components/Rating.tsx diff --git a/.phase38-state.json b/.phase38-state.json index f2c0168..8792af9 100644 --- a/.phase38-state.json +++ b/.phase38-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "slider-component", + "current_feature": "rating-component", "started_at": "2026-05-23T10:08:26.899213", "attempted_features": [ - "spinner-component" + "spinner-component", + "slider-component" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index b9971fa..4cb5e86 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -4071,3 +4071,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:08:48` **INFO** Committed feature slider-component +- `10:08:48` **INFO** Pushed: rc=0 + +## Phase-3 Feature: rating-component (2026-05-23 10:08:48) + +- `10:08:48` **INFO** Description: Rating mit Sternen +- `10:08:48` **INFO** Generating apps/web/src/components/Rating.tsx (Rating-Component. Props: value (0-5), onChange?, max? (default 5), rea…) +- `10:08:58` **INFO** wrote 992 chars in 9.5s (attempt 1) +- `10:08:58` **INFO** Running tsc --noEmit on api… +- `10:08:59` **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/Rating.tsx b/apps/web/src/components/Rating.tsx new file mode 100644 index 0000000..828f1b4 --- /dev/null +++ b/apps/web/src/components/Rating.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { Star } from 'lucide-react'; + +interface RatingProps { + value: number; + onChange?: (value: number) => void; + max?: number; + readonly?: boolean; + size?: 'sm' | 'md' | 'lg'; +} + +const sizeMap = { + sm: 16, + md: 24, + lg: 32, +}; + +export default function Rating({ + value, + onChange, + max = 5, + readonly = false, + size = 'md', +}: RatingProps) { + const iconSize = sizeMap[size]; + + return ( +
+ {Array.from({ length: max }).map((_, i) => { + const isFilled = i < value; + return ( + !readonly && onChange?.(i + 1)} + /> + ); + })} +
+ ); +} \ No newline at end of file