feat(rating-component): Rating mit Sternen [tsc:fail]
This commit is contained in:
parent
21c558de00
commit
fa9cd8971c
@ -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"
|
||||
]
|
||||
}
|
||||
@ -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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||
- `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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||
|
||||
46
apps/web/src/components/Rating.tsx
Normal file
46
apps/web/src/components/Rating.tsx
Normal file
@ -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 (
|
||||
<div className="flex items-center gap-1">
|
||||
{Array.from({ length: max }).map((_, i) => {
|
||||
const isFilled = i < value;
|
||||
return (
|
||||
<Star
|
||||
key={i}
|
||||
size={iconSize}
|
||||
className={`
|
||||
cursor-pointer transition-colors
|
||||
${isFilled ? 'fill-yellow-400 text-yellow-400' : 'text-gray-300'}
|
||||
${readonly ? 'cursor-default' : 'hover:text-yellow-500'}
|
||||
`}
|
||||
onClick={() => !readonly && onChange?.(i + 1)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user