From eb8f225e854400d5109633940987058460dbd243 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 09:49:22 +0200 Subject: [PATCH] feat(alert-component): Alert-Banner mit dismiss [tsc:fail] --- .phase34-state.json | 5 +- GENERATION_LOG.md | 18 +++++++ apps/web/src/components/Alert.tsx | 81 +++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/components/Alert.tsx diff --git a/.phase34-state.json b/.phase34-state.json index 6be84f1..01e641e 100644 --- a/.phase34-state.json +++ b/.phase34-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "accordion-component", + "current_feature": "alert-component", "started_at": "2026-05-23T09:48:28.280761", "attempted_features": [ - "tabs-component" + "tabs-component", + "accordion-component" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 13bdd1d..90c6638 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3755,3 +3755,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, +- `09:49:00` **INFO** Committed feature accordion-component +- `09:49:00` **INFO** Pushed: rc=0 + +## Phase-3 Feature: alert-component (2026-05-23 09:49:00) + +- `09:49:00` **INFO** Description: Alert-Banner mit dismiss +- `09:49:00` **INFO** Generating apps/web/src/components/Alert.tsx (Alert-Component. Props: variant ('info'|'success'|'warning'|'error'), …) +- `09:49:20` **INFO** wrote 2092 chars in 20.0s (attempt 1) +- `09:49:20` **INFO** Running tsc --noEmit on api… +- `09:49:22` **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/Alert.tsx b/apps/web/src/components/Alert.tsx new file mode 100644 index 0000000..038d0ba --- /dev/null +++ b/apps/web/src/components/Alert.tsx @@ -0,0 +1,81 @@ +import React, { useState } from 'react'; +import { Info, CheckCircle, AlertTriangle, XCircle, X } from 'lucide-react'; + +type AlertVariant = 'info' | 'success' | 'warning' | 'error'; + +interface AlertProps { + variant: AlertVariant; + title?: string; + children: React.ReactNode; + dismissible?: boolean; +} + +const variantStyles: Record = { + info: { + container: 'bg-blue-50 text-blue-800', + border: 'border-blue-200', + icon: Info, + iconColor: 'text-blue-500', + }, + success: { + container: 'bg-green-50 text-green-800', + border: 'border-green-200', + icon: CheckCircle, + iconColor: 'text-green-500', + }, + warning: { + container: 'bg-yellow-50 text-yellow-800', + border: 'border-yellow-200', + icon: AlertTriangle, + iconColor: 'text-yellow-500', + }, + error: { + container: 'bg-red-50 text-red-800', + border: 'border-red-200', + icon: XCircle, + iconColor: 'text-red-500', + }, +}; + +export default function Alert({ variant, title, children, dismissible = false }: AlertProps) { + const [isVisible, setIsVisible] = useState(true); + + if (!isVisible) return null; + + const style = variantStyles[variant]; + const Icon = style.icon; + + return ( +
+
+ +
+ +
+ {title && ( + + {title} + + )} +
+ {children} +
+
+ + {dismissible && ( + + )} +
+ ); +} \ No newline at end of file