"use client"; import { translations, Language } from "../lib/translations"; import { avatarBase64 } from "../lib/avatar"; import { userPhotoBase64 } from "../lib/user_photo"; import { useState, type Dispatch, type SetStateAction } from "react"; type SidebarTab = | "Dashboard" | "Tender Search" | "My Portfolio" | "Market Monitor" | "Company Profile" | "Agent Analysis" | "Proposal Draft" | "History" | "Documentation" | "Database" | "About"; type Props = { tabs: readonly SidebarTab[]; activeTab: SidebarTab; onTabSelect: Dispatch>; status: string; lang: Language; forceExpanded?: boolean; }; export default function Sidebar({ tabs, activeTab, onTabSelect, status, lang, forceExpanded = false }: Props) { const t = translations[lang]; const [isHovered, setIsHovered] = useState(false); const isExpanded = forceExpanded || isHovered; const getTabLabel = (tab: SidebarTab) => { switch(tab) { case "Dashboard": return { label: t.dashboard, icon: "πŸ“Š" }; case "Tender Search": return { label: t.tenderSearch, icon: "πŸ“‘" }; case "My Portfolio": return { label: t.myPortfolio, icon: "β˜…" }; case "Market Monitor": return { label: "Market Monitor", icon: "πŸ›’" }; case "Company Profile": return { label: t.companyProfile, icon: "🏒" }; case "Agent Analysis": return { label: t.agentAnalysis, icon: "πŸ€–" }; case "Proposal Draft": return { label: t.proposalDraft, icon: "✍️" }; case "History": return { label: t.history, icon: "πŸ•’" }; case "Documentation": return { label: t.documentation, icon: "πŸ“š" }; case "Database": return { label: "Local DB", icon: "πŸ—„οΈ" }; case "About": return { label: t.about, icon: "ℹ️" }; default: return { label: tab, icon: "β€’" }; } }; return ( ); }