import { ChevronLeft, ChevronRight } from 'lucide-react'; import { ReactElement, useCallback, useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; type SidebarItem = { name: string; value: string; id: number; icon?: ReactElement; }; type SidebarProps = { title: string; items: SidebarItem[]; }; export const Sidebar = ({ title, items }: SidebarProps) => { const [isOpen, setIsOpen] = useState(window.innerWidth >= 768); const location = useLocation(); const toggleSidebar = useCallback( () => setIsOpen(prevState => !prevState), [], ); return (