"use client"; import React, { useState } from 'react'; interface ProductTabsWrapperProps { descriptionHtml: React.ReactNode; specsHtml: React.ReactNode; showSpecifications?: boolean; } type TabId = 'description' | 'specs'; const TAB_LINE = 'border-[#e0e0e0]'; const BOX = 'border border-[#e0e0e0]'; export const ProductTabsWrapper: React.FC = ({ descriptionHtml, specsHtml, showSpecifications = true, }) => { const [activeTab, setActiveTab] = useState('description'); const tabs: { id: TabId; label: string }[] = [ { id: 'description', label: 'Description' }, ...(showSpecifications ? [{ id: 'specs' as TabId, label: 'Specifications' }] : []), ]; return (
{/* Tab Headers */}
{tabs.map((tab) => { const isActive = activeTab === tab.id; return ( ); })}
{/* Tab Panels */}
{/* ── Description ── */}
{descriptionHtml ? ( descriptionHtml ) : (

No description available for this product.

)}
{/* ── Specifications ── */}
{specsHtml}
); };