"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { signOut } from "next-auth/react"; // Icons for the sidebar const DashboardIcon = () => ( ); const CompanyIcon = () => ( ); const UsersIcon = () => ( ); const SessionsIcon = () => ( ); const LogoutIcon = () => ( ); const ToggleIcon = ({ isExpanded }: { isExpanded: boolean }) => ( ); interface NavItemProps { href: string; label: string; icon: React.ReactNode; isExpanded: boolean; isActive: boolean; } const NavItem: React.FC = ({ href, label, icon, isExpanded, isActive, }) => ( {icon} {isExpanded ? ( {label} ) : (
{label}
)} ); export default function Sidebar() { const [isExpanded, setIsExpanded] = useState(true); const pathname = usePathname() || ""; const toggleSidebar = () => { setIsExpanded(!isExpanded); }; const handleLogout = () => { signOut({ callbackUrl: "/login" }); }; return (
{/* Logo section - now above toggle button */}
LiveDash Logo
{isExpanded && ( LiveDash )}
{/* Toggle button */}
{/* Navigation items */} {/* Logout at the bottom */}
); }