|
1 | 1 | "use client" |
2 | 2 |
|
3 | 3 | import { useState, useEffect } from 'react' |
4 | | -import { User, ChevronDown, LogOut, Moon, Sun, AlertTriangle, Calculator, TrendingUp, FolderUp, GitCompare, Edit } from 'lucide-react' |
| 4 | +import { User, ChevronDown, LogOut, Moon, Sun, AlertTriangle, Calculator, TrendingUp, FolderUp, GitCompare, Edit, Menu } from 'lucide-react' |
5 | 5 | import { Button } from '@/components/ui/button' |
6 | 6 | import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card' |
7 | 7 | import { Alert, AlertDescription } from '@/components/ui/alert' |
@@ -58,32 +58,48 @@ export default function TopBar({ sidebarOpen, onToggleSidebar, activeTab, onTabC |
58 | 58 | { |
59 | 59 | title: "Calculate Tariff", |
60 | 60 | icon: <Calculator className="h-full w-full" />, |
61 | | - onClick: () => navigateToBaseAndChangeTab("calculate") |
| 61 | + onClick: () => navigateToBaseAndChangeTab("calculate"), |
| 62 | + isActive: pathname === '/' && activeTab === 'calculate' |
62 | 63 | }, |
63 | 64 | // Admin-only: Manage Chatbot Documents tab |
64 | 65 | ...(isAdmin() ? [{ |
65 | 66 | title: "Manage Chatbot Documents", |
66 | 67 | icon: <FolderUp className="h-full w-full" />, |
67 | | - onClick: () => navigateToBaseAndChangeTab("manage-docs") |
| 68 | + onClick: () => navigateToBaseAndChangeTab("manage-docs"), |
| 69 | + isActive: pathname === '/' && activeTab === 'manage-docs' |
68 | 70 | }] : []), |
69 | 71 | // Admin-only: Tariff Management |
70 | 72 | ...(isAdmin() ? [{ |
71 | 73 | title: "Tariff Management", |
72 | 74 | icon: <Edit className="h-full w-full" />, |
73 | | - onClick: () => router.push('/edit') |
| 75 | + onClick: () => router.push('/edit'), |
| 76 | + isActive: pathname === '/edit' |
74 | 77 | }] : []), |
75 | 78 | { |
76 | 79 | title: "Results", |
77 | 80 | icon: <TrendingUp className="h-full w-full" />, |
78 | | - onClick: () => router.push('/compare') |
| 81 | + onClick: () => router.push('/compare'), |
| 82 | + isActive: pathname === '/compare' |
79 | 83 | }, |
80 | 84 | ] |
81 | 85 |
|
82 | 86 | return ( |
83 | 87 | <> |
84 | 88 | <header className="h-20 border-b border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 flex items-center justify-center px-6 relative"> |
85 | | - {/* Left side - Empty spacer for balance */} |
86 | | - <div className="absolute left-6 w-64"></div> |
| 89 | + {/* Left side - Logo and Burger Menu */} |
| 90 | + <div className="absolute left-6 flex items-center gap-3"> |
| 91 | + {/* Burger Menu Button - Only show when sidebar is closed */} |
| 92 | + {!sidebarOpen && ( |
| 93 | + <Button |
| 94 | + variant="ghost" |
| 95 | + size="sm" |
| 96 | + onClick={onToggleSidebar} |
| 97 | + className="text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700" |
| 98 | + > |
| 99 | + <Menu className="h-5 w-5" /> |
| 100 | + </Button> |
| 101 | + )} |
| 102 | + </div> |
87 | 103 |
|
88 | 104 | {/* Center - Floating Dock Navigation */} |
89 | 105 | <div className="flex justify-center"> |
|
0 commit comments