diff --git a/src/shared-ui/Panel.tsx b/src/shared-ui/Panel.tsx index cefa893b..1957fbc5 100644 --- a/src/shared-ui/Panel.tsx +++ b/src/shared-ui/Panel.tsx @@ -1,14 +1,31 @@ -import type { PropsWithChildren } from "react"; +import { useId, useState, type PropsWithChildren } from "react"; interface PanelProps extends PropsWithChildren { title: string; + defaultExpanded?: boolean; } -export function Panel({ title, children }: PanelProps) { +export function Panel({ title, children, defaultExpanded = true }: PanelProps) { + const [isExpanded, setIsExpanded] = useState(defaultExpanded); + const bodyId = useId(); + return ( -
-
{title}
-
{children}
+
+ + {isExpanded ? ( +
+ {children} +
+ ) : null}
); }