"use client"; import { useState } from "react"; import TabNavigation from "./TabNavigation"; import OverviewTab from "./OverviewTab"; import { useApp } from "@/contexts/AppContext"; export default function ContentSection() { const { t } = useApp(); const tabs = [ { id: "overview", label: t("tabs.overview") }, { id: "asset-description", label: t("tabs.assetDescription") }, { id: "analytics", label: t("tabs.analytics") }, { id: "performance-analysis", label: t("tabs.performanceAnalysis") }, { id: "asset-custody", label: t("tabs.assetCustody") }, ]; const [activeTab, setActiveTab] = useState("overview"); const handleTabChange = (tabId: string) => { // If clicking asset-description, performance-analysis, or asset-custody, scroll to that section if (tabId === "asset-description" || tabId === "performance-analysis" || tabId === "asset-custody") { setTimeout(() => { const element = document.getElementById(tabId); if (element) { element.scrollIntoView({ behavior: "smooth", block: "start" }); } }, 100); // Keep active tab as overview setActiveTab("overview"); } else { setActiveTab(tabId); } }; // Show OverviewTab for overview, asset-description, analytics, performance-analysis, and asset-custody const showOverview = ["overview", "asset-description", "analytics", "performance-analysis", "asset-custody"].includes(activeTab); return (
{/* Tab Navigation */} {/* Content Area */}
{showOverview && } {!showOverview && (

{tabs.find((t) => t.id === activeTab)?.label} content will be displayed here...

)}
); }