import { useCallback } from 'react'; import { useMatch, useNavigate, useResolvedPath } from 'react-router-dom'; import { useTheme } from '@emotion/react'; import { useAuth } from '@/auth/hooks/useAuth'; import { AppPath } from '@/types/AppPath'; import { IconColorSwatch, IconLogout, IconSettings, IconUser, IconUsers, } from '@/ui/icon/index'; import NavItem from '@/ui/navbar/components/NavItem'; import NavTitle from '@/ui/navbar/components/NavTitle'; import SubMenuNavbar from '@/ui/navbar/components/SubMenuNavbar'; export function SettingsNavbar() { const theme = useTheme(); const navigate = useNavigate(); const { signOut } = useAuth(); const handleLogout = useCallback(() => { signOut(); navigate(AppPath.SignIn); }, [signOut, navigate]); return ( } active={ !!useMatch({ path: useResolvedPath('/settings/profile').pathname, end: true, }) } /> } active={ !!useMatch({ path: useResolvedPath('/settings/profile/experience').pathname, end: true, }) } /> } active={ !!useMatch({ path: useResolvedPath('/settings/workspace-members').pathname, end: true, }) } /> } active={ !!useMatch({ path: useResolvedPath('/settings/workspace').pathname, end: true, }) } /> } danger={true} /> ); }