import React from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { Home, BarChart2, Calendar, Settings } from 'lucide-react'; import { cn } from '@/lib/utils'; const NavBar = () => { const navigate = useNavigate(); const location = useLocation(); // 설정 관련 경로 목록 추가 const settingsRelatedPaths = [ '/settings', '/profile', '/security-privacy', '/help-support', '/payment-methods', '/notifications' ]; const isSettingsActive = settingsRelatedPaths.some(path => location.pathname === path); const navItems = [ { icon: Home, label: '홈', path: '/', isActive: location.pathname === '/' }, { icon: Calendar, label: '지출', path: '/transactions', isActive: location.pathname === '/transactions' }, { icon: BarChart2, label: '분석', path: '/analytics', isActive: location.pathname === '/analytics' }, { icon: Settings, label: '설정', path: '/settings', isActive: isSettingsActive }, ]; return (
{navItems.map((item) => { return ( ); })}
); }; export default NavBar;