import { NavLink, Link, useNavigate } from 'react-router-dom' import { ChevronDown, ChevronRight, FileText, FolderOpen, Home, Info, LogOut, Plus, ShieldCheck, } from 'lucide-react' import { cn } from '@/lib/utils' import { Separator } from '@/components/ui/separator' import { Button } from '@/components/ui/button' import { useAuth } from '@/context/AuthContext' import { useWorkspace } from '@/context/WorkspaceContext' interface SidebarProps { className?: string } const mainNav = [ { to: '/', label: 'Home', icon: Home }, { to: '/about', label: 'About', icon: Info }, { to: '/security', label: 'Security', icon: ShieldCheck }, ] export function Sidebar({ className }: SidebarProps) { const { isAuthenticated, signOut } = useAuth() const navigate = useNavigate() const { parents, childrenByParent, expandedParents, selection, parentOfSelection, toggleExpand, selectParent, selectChild, requestCreate, } = useWorkspace() const createHint = parentOfSelection === null ? 'Creates a new top-level page' : `Creates a child under "${parentOfSelection.title || 'untitled page'}"` function handleCreateParent() { requestCreate('parent') navigate('/workspace') } function handleCreateChild() { requestCreate('child') navigate('/workspace') } return ( ) }