"use client"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { cn } from "@/lib/utils"; import { motion } from "framer-motion"; import { LayoutDashboard, ArrowRightLeft, BarChart2, Wallet, Target, MessageSquare, Settings, LogOut, Zap, Shield, Sparkles, Activity, CreditCard, Sun, Moon, Globe, } from "lucide-react"; import { useAuthStore } from "@/lib/stores/authStore"; import { useThemeStore } from "@/lib/stores/themeStore"; import { useLanguageStore, LANGUAGES, Language } from "@/lib/stores/languageStore"; import { useState } from "react"; export function Sidebar() { const pathname = usePathname(); const router = useRouter(); const { logout } = useAuthStore(); const { theme, toggle } = useThemeStore(); const { language, setLanguage, t } = useLanguageStore(); const [showLang, setShowLang] = useState(false); const navigation = [ { key: "overview", href: "/", icon: LayoutDashboard }, { key: "transactions", href: "/transactions", icon: ArrowRightLeft }, { key: "payments", href: "/payments", icon: CreditCard, badge: "NEW" }, { key: "analytics", href: "/analytics", icon: BarChart2 }, { key: "simulator", href: "/simulator", icon: Zap }, { key: "loans", href: "/loans", icon: Wallet }, { key: "goals", href: "/goals", icon: Target }, { key: "ai_assistant", href: "/chat", icon: MessageSquare, badge: "AI" }, { key: "security", href: "/security", icon: Shield }, { key: "system_status", href: "/status", icon: Activity }, { key: "settings", href: "/settings", icon: Settings }, ]; const handleLogout = () => { logout(); router.replace("/login"); }; const isLight = theme === "light"; return (
{/* ── Logo ─────────────────────────────────────────────────────────────── */}

BankBot

AI Finance

{/* ── Nav ──────────────────────────────────────────────────────────────── */}
{/* ── Bottom controls ───────────────────────────────────────────────── */}
{/* AI Shield status */}

{t("ai_shield")}

{t("all_normal")}

{/* Theme toggle */} {/* Language switcher */}
{showLang && ( {(Object.entries(LANGUAGES) as [Language, typeof LANGUAGES[Language]][]).map( ([code, info]) => ( ) )} )}
{/* Sign out */}
); }