import { CogIcon, DatabaseIcon, FolderIcon, GlobeIcon, OfficeBuildingIcon, ReplyIcon, ServerIcon, TerminalIcon, UserGroupIcon, UsersIcon, ViewGridIcon, } from '@heroicons/react/outline'; import { useStoreState } from 'easy-peasy'; import { useState } from 'react'; import { NavLink, Route, Routes } from 'react-router-dom'; import tw from 'twin.macro'; import CollapsedIcon from '@/assets/images/pterodactyl.svg'; import OverviewContainer from '@/components/admin/overview/OverviewContainer'; import SettingsContainer from '@/components/admin/settings/SettingsContainer'; import DatabasesContainer from '@/components/admin/databases/DatabasesContainer'; import NewDatabaseContainer from '@/components/admin/databases/NewDatabaseContainer'; import DatabaseEditContainer from '@/components/admin/databases/DatabaseEditContainer'; import NodesContainer from '@/components/admin/nodes/NodesContainer'; import NewNodeContainer from '@/components/admin/nodes/NewNodeContainer'; import NodeRouter from '@/components/admin/nodes/NodeRouter'; import LocationsContainer from '@/components/admin/locations/LocationsContainer'; import LocationEditContainer from '@/components/admin/locations/LocationEditContainer'; import ServersContainer from '@/components/admin/servers/ServersContainer'; import NewServerContainer from '@/components/admin/servers/NewServerContainer'; import ServerRouter from '@/components/admin/servers/ServerRouter'; import NewUserContainer from '@/components/admin/users/NewUserContainer'; import UserRouter from '@/components/admin/users/UserRouter'; import RolesContainer from '@/components/admin/roles/RolesContainer'; import RoleEditContainer from '@/components/admin/roles/RoleEditContainer'; import NestsContainer from '@/components/admin/nests/NestsContainer'; import NestEditContainer from '@/components/admin/nests/NestEditContainer'; import NewEggContainer from '@/components/admin/nests/NewEggContainer'; import EggRouter from '@/components/admin/nests/eggs/EggRouter'; import MountsContainer from '@/components/admin/mounts/MountsContainer'; import NewMountContainer from '@/components/admin/mounts/NewMountContainer'; import MountEditContainer from '@/components/admin/mounts/MountEditContainer'; import { NotFound } from '@/components/elements/ScreenBlock'; import type { ApplicationStore } from '@/state'; import Sidebar from '@/components/admin/Sidebar'; // import useUserPersistedState from '@/plugins/useUserPersistedState'; import UsersContainer from '@/components/admin/users/UsersContainer'; function AdminRouter() { const email = useStoreState((state: ApplicationStore) => state.user.data!.email); const roleName = useStoreState((state: ApplicationStore) => state.user.data!.roleName); const avatarURL = useStoreState((state: ApplicationStore) => state.user.data!.avatarURL); const applicationName = useStoreState((state: ApplicationStore) => state.settings.data!.name); // const [collapsed, setCollapsed] = useUserPersistedState('admin_sidebar_collapsed', false); const [collapsed, setCollapsed] = useState(false); return (
setCollapsed(!collapsed)} > {!collapsed ? (

{applicationName}

) : ( {'Pterodactyl )}
Administration Overview Settings Management Databases Locations Nodes Servers Users Roles Service Management Nests Mounts Return {avatarURL && ( Profile Picture )}
{email} {roleName}
} /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } />
); } export default AdminRouter;