"use client" import type React from "react" import { useState } from "react" import Link from "next/link" import { Home, Globe, Server, Layout, Clock, PenToolIcon as Tool, Settings, LogOut, ChevronDown, Menu, } from "lucide-react" import packageJson from "@/package.json" import Image from "next/image" import Cookies from "js-cookie" import { useRouter } from "next/navigation" interface SidebarProps { children: React.ReactNode username: string fullName: string } export default function Sidebar({ children, username, fullName }: SidebarProps) { const router = useRouter() const [isProfileOpen, setIsProfileOpen] = useState(false) const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false) const initials = useState(() => { const nameToUse = fullName || username return nameToUse .split(" ") .filter((part) => part.length > 0) .map((part) => part[0]) .join("") .toUpperCase() .substring(0, 2) })[0] const logout = () => { Cookies.remove("token") router.push("/") } return (
{/* Mobile menu button */}
CoreControl
{/* Sidebar */} {/* Main content */}
{children}
) }