diff --git a/admin-spa/src/components/VerticalTabForm.tsx b/admin-spa/src/components/VerticalTabForm.tsx index a632ebc..ff73297 100644 --- a/admin-spa/src/components/VerticalTabForm.tsx +++ b/admin-spa/src/components/VerticalTabForm.tsx @@ -66,20 +66,20 @@ export function VerticalTabForm({ tabs, children, className }: VerticalTabFormPr }; return ( -
- {/* Vertical Tabs Sidebar */} -
-
+
+ {/* Mobile: Horizontal Tabs */} +
+
{tabs.map((tab) => (
- {/* Content Area */} -
+ {/* Desktop: Vertical Layout */} +
+ {/* Vertical Tabs Sidebar */} +
+
+ {tabs.map((tab) => ( + + ))} +
+
+ + {/* Content Area - Desktop */} +
+ {React.Children.map(children, (child) => { + if (React.isValidElement(child) && child.props['data-section-id']) { + const sectionId = child.props['data-section-id']; + const isActive = sectionId === activeTab; + const originalClassName = child.props.className || ''; + return React.cloneElement(child as React.ReactElement, { + ref: (el: HTMLElement) => registerSection(sectionId, el), + className: isActive ? originalClassName : `${originalClassName} hidden`.trim(), + }); + } + return child; + })} +
+
+ + {/* Mobile: Content Area */} +
{React.Children.map(children, (child) => { if (React.isValidElement(child) && child.props['data-section-id']) { const sectionId = child.props['data-section-id']; const isActive = sectionId === activeTab; + const originalClassName = child.props.className || ''; return React.cloneElement(child as React.ReactElement, { - ref: (el: HTMLElement) => registerSection(sectionId, el), - className: isActive ? '' : 'hidden', + className: isActive ? originalClassName : `${originalClassName} hidden`.trim(), }); } return child;