import React, { useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { Area } from '../entities/Area'; import { Note } from '../entities/Note'; import { Tag } from '../entities/Tag'; import SidebarAreas from './Sidebar/SidebarAreas'; import SidebarFooter from './Sidebar/SidebarFooter'; import SidebarNav from './Sidebar/SidebarNav'; import SidebarNotes from './Sidebar/SidebarNotes'; import SidebarProjects from './Sidebar/SidebarProjects'; import SidebarTags from './Sidebar/SidebarTags'; interface SidebarProps { isSidebarOpen: boolean; setIsSidebarOpen: React.Dispatch>; currentUser: { email: string }; isDarkMode: boolean; toggleDarkMode: () => void; openTaskModal: (type?: 'simplified' | 'full') => void; openProjectModal: () => void; openNoteModal: (note: Note | null) => void; openAreaModal: (area: Area | null) => void; openTagModal: (tag: Tag | null) => void; notes: Note[]; areas: Area[]; tags: Tag[]; } const Sidebar: React.FC = ({ isSidebarOpen, setIsSidebarOpen, currentUser, isDarkMode, toggleDarkMode, openTaskModal, openProjectModal, openNoteModal, openAreaModal, openTagModal, notes, areas, tags, }) => { const navigate = useNavigate(); const location = useLocation(); const [isDropdownOpen, setIsDropdownOpen] = useState(false); const toggleDropdown = () => { setIsDropdownOpen(!isDropdownOpen); }; const handleNavClick = (path: string, title: string) => { navigate(path, { state: { title } }); if (window.innerWidth < 1024) { setIsSidebarOpen(false); } }; return (
{isSidebarOpen && (
{/* Sidebar Contents */}
)}
); }; export default Sidebar;