feat(tag-component): Tag mit Color + Click-Handler [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 10:29:44 +02:00
parent 6580e5262a
commit cbcbee2712
3 changed files with 69 additions and 2 deletions

View File

@ -1,9 +1,10 @@
{
"completed_features": [],
"current_feature": "popover-component",
"current_feature": "tag-component",
"started_at": "2026-05-23T10:28:27.180963",
"attempted_features": [
"button-group-component",
"context-menu-component"
"context-menu-component",
"popover-component"
]
}

View File

@ -4405,3 +4405,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:29:24` **INFO** Committed feature popover-component
- `10:29:24` **INFO** Pushed: rc=0
## Phase-3 Feature: tag-component (2026-05-23 10:29:24)
- `10:29:24` **INFO** Description: Tag mit Color + Click-Handler
- `10:29:24` **INFO** Generating apps/web/src/components/Tag.tsx (Tag-Component. Props: label, color? (default 'gray'), onClick?, onRemo…)
- `10:29:42` **INFO** wrote 1698 chars in 18.3s (attempt 1)
- `10:29:42` **INFO** Running tsc --noEmit on api…
- `10:29:44` **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>,

View File

@ -0,0 +1,48 @@
import React from 'react';
interface TagProps {
label: string;
color?: 'gray' | 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'indigo';
onClick?: () => void;
onRemove?: () => void;
}
const colorMap = {
gray: 'bg-gray-100 text-gray-800 border-gray-200 hover:bg-gray-200',
blue: 'bg-blue-100 text-blue-800 border-blue-200 hover:bg-blue-200',
green: 'bg-green-100 text-green-800 border-green-200 hover:bg-green-200',
red: 'bg-red-100 text-red-800 border-red-200 hover:bg-red-200',
yellow: 'bg-yellow-100 text-yellow-800 border-yellow-200 hover:bg-yellow-200',
purple: 'bg-purple-100 text-purple-800 border-purple-200 hover:bg-purple-200',
indigo: 'bg-indigo-100 text-indigo-800 border-indigo-200 hover:bg-indigo-200',
};
export default function Tag({ label, color = 'gray', onClick, onRemove }: TagProps) {
const colorClasses = colorMap[color] || colorMap.gray;
return (
<span
className={`
inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border transition-colors
${colorClasses}
${onClick ? 'cursor-pointer select-none' : ''}
`}
onClick={onClick}
>
{label}
{onRemove && (
<button
onClick={(e) => {
e.stopPropagation();
onRemove();
}}
className="ml-1.5 inline-flex items-center justify-center w-3 h-3 rounded-full hover:bg-black/10 transition-colors"
>
<svg className="w-2 h-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="3" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
)}
</span>
);
}