diff --git a/.phase31-state.json b/.phase31-state.json index d8f89bf..1933763 100644 --- a/.phase31-state.json +++ b/.phase31-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "empty-state-illustrations", + "current_feature": "button-loading-states", "started_at": "2026-05-23T09:33:26.338003", "attempted_features": [ - "toast-undo-pattern" + "toast-undo-pattern", + "empty-state-illustrations" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 7ee6949..f0e0579 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3518,3 +3518,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:33:49` **INFO** Committed feature empty-state-illustrations +- `09:33:49` **INFO** Pushed: rc=0 + +## Phase-3 Feature: button-loading-states (2026-05-23 09:33:49) + +- `09:33:49` **INFO** Description: Button mit loading-prop zeigt Spinner +- `09:33:49` **INFO** Generating apps/web/src/components/Button.tsx (Button-Component. Props: variant ('primary'|'secondary'|'danger'), loa…) +- `09:34:01` **INFO** wrote 1265 chars in 11.7s (attempt 1) +- `09:34:01` **INFO** Running tsc --noEmit on api… +- `09:34:02` **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/Button.tsx b/apps/web/src/components/Button.tsx new file mode 100644 index 0000000..d8375cc --- /dev/null +++ b/apps/web/src/components/Button.tsx @@ -0,0 +1,47 @@ +import React from 'react'; +import { Loader2 } from 'lucide-react'; + +type ButtonVariant = 'primary' | 'secondary' | 'danger'; + +interface ButtonProps extends React.ButtonHTMLAttributes { + variant?: ButtonVariant; + loading?: boolean; + children: React.ReactNode; +} + +const variantClasses: Record = { + primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500', + secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300 focus:ring-gray-400', + danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500', +}; + +export default function Button({ + variant = 'primary', + loading = false, + disabled, + children, + className = '', + ...props +}: ButtonProps) { + const isDisabled = disabled || loading; + + return ( + + ); +} \ No newline at end of file