feat(search-box-component): SearchBox mit clear-button [tsc:fail]
This commit is contained in:
parent
116da565a7
commit
239d2f9e17
@ -1,9 +1,10 @@
|
||||
{
|
||||
"completed_features": [],
|
||||
"current_feature": "select-component",
|
||||
"current_feature": "search-box-component",
|
||||
"started_at": "2026-05-23T09:58:25.839766",
|
||||
"attempted_features": [
|
||||
"input-component",
|
||||
"textarea-component"
|
||||
"textarea-component",
|
||||
"select-component"
|
||||
]
|
||||
}
|
||||
@ -3931,3 +3931,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>,
|
||||
- `09:59:25` **INFO** Committed feature select-component
|
||||
- `09:59:25` **INFO** Pushed: rc=0
|
||||
|
||||
## Phase-3 Feature: search-box-component (2026-05-23 09:59:25)
|
||||
|
||||
- `09:59:25` **INFO** Description: SearchBox mit clear-button
|
||||
- `09:59:25` **INFO** Generating apps/web/src/components/SearchBox.tsx (SearchBox-Component. Props: value, onChange, placeholder? (default 'Su…)
|
||||
- `09:59:37` **INFO** wrote 1305 chars in 12.0s (attempt 1)
|
||||
- `09:59:37` **INFO** Running tsc --noEmit on api…
|
||||
- `09:59:39` **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>,
|
||||
|
||||
45
apps/web/src/components/SearchBox.tsx
Normal file
45
apps/web/src/components/SearchBox.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
import { Search, X } from 'lucide-react';
|
||||
|
||||
interface SearchBoxProps {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
placeholder?: string;
|
||||
onClear?: () => void;
|
||||
}
|
||||
|
||||
export default function SearchBox({
|
||||
value,
|
||||
onChange,
|
||||
placeholder = 'Suchen...',
|
||||
onClear,
|
||||
}: SearchBoxProps) {
|
||||
const handleClear = () => {
|
||||
onChange('');
|
||||
if (onClear) onClear();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="relative w-full max-w-md">
|
||||
<div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
|
||||
<Search className="w-4 h-4 text-slate-400" />
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
placeholder={placeholder}
|
||||
className="block w-full pl-10 pr-10 py-2 text-sm text-slate-900 border border-slate-200 rounded-lg bg-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder:text-slate-400"
|
||||
/>
|
||||
{value && (
|
||||
<button
|
||||
onClick={handleClear}
|
||||
className="absolute inset-y-0 right-0 flex items-center pr-3 text-slate-400 hover:text-slate-600 transition-colors"
|
||||
type="button"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user