"use client"; import React, { useState, useEffect } from 'react'; import { ProductReviewsSection } from './ProductReviewsSection'; interface ProductTabsWrapperProps { productId?: string; productName?: string; initialReviewsCount?: number; descriptionHtml: React.ReactNode; specsHtml: React.ReactNode; showSpecifications?: boolean; } type TabId = 'description' | 'specs' | 'reviews'; const BOX = 'border border-gray-200 rounded-xl overflow-hidden'; export const ProductTabsWrapper: React.FC = ({ productId, productName, initialReviewsCount = 0, descriptionHtml, specsHtml, showSpecifications = true, }) => { const [activeTab, setActiveTab] = useState('description'); const [reviewsCount, setReviewsCount] = useState(initialReviewsCount); useEffect(() => { if (typeof window !== 'undefined' && window.location.hash === '#reviews') { setActiveTab('reviews'); setTimeout(() => { document.getElementById('product-tabs')?.scrollIntoView({ behavior: 'smooth' }); }, 150); } }, []); return (
{/* Modern High-Visibility Tab Bar */}
{showSpecifications && ( )}
{/* Tab Panels */}
{/* ── Description ── */}
{descriptionHtml ? ( descriptionHtml ) : (

No description available for this product.

)}
{/* ── Specifications ── */}
{specsHtml}
{/* ── Reviews ── */}
{productId ? ( ) : (

Reviews unavailable

)}
); };