import { State, useStoreState } from 'easy-peasy'; import React from 'react'; import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom'; import tw from 'twin.macro'; 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 { ApplicationStore } from '@/state'; import { AdminContext } from '@/state/admin'; import { CogIcon, DatabaseIcon, FolderIcon, GlobeIcon, OfficeBuildingIcon, ReplyIcon, ServerIcon, TerminalIcon, UserGroupIcon, UsersIcon, ViewGridIcon, } from '@heroicons/react/outline'; import CollapsedIcon from '@/assets/images/pterodactyl.svg'; import Sidebar from '@/components/admin/Sidebar'; import useUserPersistedState from '@/plugins/useUserPersistedState'; import UsersContainerV2 from '@/components/admin/users/UsersContainerV2'; const AdminRouter = ({ location, match }: RouteComponentProps) => { const email = useStoreState((state: State) => state.user.data!.email); const roleName = useStoreState((state: State) => state.user.data!.roleName); const avatarURL = useStoreState((state: State) => state.user.data!.avatarURL); const applicationName = useStoreState((state: ApplicationStore) => state.settings.data!.name); const [ collapsed, setCollapsed ] = useUserPersistedState('admin_sidebar_collapsed', 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 (props: RouteComponentProps) => ( );