'use client'; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useAuth } from '@/lib/auth'; import { LayoutDashboard, TrendingUp, KeyRound, Bot, Settings, User, LogOut, Menu, } from 'lucide-react'; import { cn } from '@/lib/cn'; const NAV = [ { href: '/', label: '대시보드', icon: LayoutDashboard }, { href: '/trades', label: '트레이드 이력', icon: TrendingUp }, { href: '/exchange', label: '거래소 API', icon: KeyRound }, { href: '/automation', label: '자동매매', icon: Bot }, { href: '/settings', label: '시스템 설정', icon: Settings }, { href: '/profile', label: '내 정보', icon: User }, ]; const Logo = ({ mini = false }: { mini?: boolean }) => ( ); export default function Sidebar() { const pathname = usePathname(); const { user, logout } = useAuth(); const [mini, setMini] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); useEffect(() => { setMobileOpen(false); }, [pathname]); const initial = (user?.username?.[0] || '?').toUpperCase(); const w = mini ? 'w-[68px]' : 'w-[260px]'; return ( <> {/* 모바일 햄버거 (사이드바 밖) */} {/* 모바일 오버레이 */} {mobileOpen && (