diff --git a/.phase34-state.json b/.phase34-state.json index 95cb4c2..6be84f1 100644 --- a/.phase34-state.json +++ b/.phase34-state.json @@ -1,5 +1,8 @@ { "completed_features": [], - "current_feature": "tabs-component", - "started_at": "2026-05-23T09:48:28.280761" + "current_feature": "accordion-component", + "started_at": "2026-05-23T09:48:28.280761", + "attempted_features": [ + "tabs-component" + ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 513c5fa..13bdd1d 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3737,3 +3737,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:48:43` **INFO** Committed feature tabs-component +- `09:48:43` **INFO** Pushed: rc=0 + +## Phase-3 Feature: accordion-component (2026-05-23 09:48:43) + +- `09:48:43` **INFO** Description: Accordion mit collapsible Sections +- `09:48:43` **INFO** Generating apps/web/src/components/Accordion.tsx (Accordion-Component. Props: items (array {id, title, content: ReactNod…) +- `09:48:58` **INFO** wrote 1724 chars in 15.0s (attempt 1) +- `09:48:58` **INFO** Running tsc --noEmit on api… +- `09:49:00` **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/Accordion.tsx b/apps/web/src/components/Accordion.tsx new file mode 100644 index 0000000..e64f06b --- /dev/null +++ b/apps/web/src/components/Accordion.tsx @@ -0,0 +1,61 @@ +import React, { useState } from 'react'; +import { ChevronDown } from 'lucide-react'; + +interface AccordionItem { + id: string; + title: string; + content: React.ReactNode; +} + +interface AccordionProps { + items: AccordionItem[]; + allowMultiple?: boolean; +} + +export default function Accordion({ items, allowMultiple = false }: AccordionProps) { + const [openIds, setOpenIds] = useState>(new Set()); + + const toggleItem = (id: string) => { + setOpenIds((prev) => { + const next = new Set(prev); + if (next.has(id)) { + next.delete(id); + } else { + if (!allowMultiple) { + next.clear(); + } + next.add(id); + } + return next; + }); + }; + + return ( +
+ {items.map((item) => { + const isOpen = openIds.has(item.id); + return ( +
+ + {isOpen && ( +
+ {item.content} +
+ )} +
+ ); + })} +
+ ); +} \ No newline at end of file