"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import useStore from "@/lib/store"; import { Sparkles, FileText, ListTodo, Palette, Presentation, History, Settings, Github, Menu, X, Megaphone, Languages, Search, MessageSquare } from "lucide-react"; import { cn } from "@/lib/utils"; import { translations } from "@/lib/i18n/translations"; export type View = "enhance" | "prd" | "action" | "uxdesigner" | "slides" | "googleads" | "market-research" | "ai-assist" | "history" | "settings"; interface SidebarProps { currentView: View; onViewChange: (view: View) => void; } export default function Sidebar({ currentView, onViewChange }: SidebarProps) { const { language, setLanguage, history } = useStore(); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const t = translations[language].sidebar; const common = translations[language].common; const menuItems = [ { id: "enhance" as View, label: t.promptEnhancer, icon: Sparkles }, { id: "prd" as View, label: t.prdGenerator, icon: FileText }, { id: "action" as View, label: t.actionPlan, icon: ListTodo }, { id: "uxdesigner" as View, label: t.uxDesigner, icon: Palette }, { id: "slides" as View, label: t.slidesGen, icon: Presentation }, { id: "googleads" as View, label: t.googleAds, icon: Megaphone }, { id: "market-research" as View, label: t.marketResearch, icon: Search }, { id: "ai-assist" as View, label: t.aiAssist, icon: MessageSquare }, { id: "history" as View, label: t.history, icon: History, count: history.length }, { id: "settings" as View, label: t.settings, icon: Settings }, ]; const handleViewChange = (view: View) => { onViewChange(view); setIsMobileMenuOpen(false); }; const SidebarContent = () => ( <>
{t.backToRommark}

PA
{t.title}

{t.viewOnGithub}

{t.forkedFrom} Clavix

{t.quickTips}

); return ( <> {/* Mobile Header */}
PA
{t.title}
{/* Mobile Menu Overlay */} {isMobileMenuOpen && (
setIsMobileMenuOpen(false)} /> )} {/* Mobile Slide-out Menu */} {/* Desktop Sidebar */} ); }