import { BookOpen, Code2, HeartHandshake, LifeBuoy } from 'lucide-react'; import { Link, type LinkProps } from '@tanstack/react-router'; import Icon from '@/components/elements/Icon'; import { useAdminVersion } from '@/api/admin/version/queries'; import type { AdminVersion } from '@/api/admin/version/queries'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import OverviewVersionCard from '@/components/admin/overview/OverviewVersionCard'; import Spinner from '@/components/elements/Spinner'; import { httpErrorToHuman } from '@/api/http'; import { ServerError } from '@/components/elements/ScreenBlock'; import Slot from '@/extensions/Slot'; import { interactiveSurfaceClass } from '@/components/ui/styles'; import { cn } from '@/lib/cn'; const sections: { to: LinkProps['to']; label: string; description: string }[] = [ { to: '/panel/users', label: 'Users', description: 'Create, edit, and remove user accounts.' }, { to: '/panel/locations', label: 'Locations', description: 'Group nodes into physical locations.' }, { to: '/panel/nodes', label: 'Nodes', description: 'Manage Wings daemons and allocations.' }, { to: '/panel/servers', label: 'Servers', description: 'Provision and manage game servers.' }, { to: '/panel/databases', label: 'Database Hosts', description: 'Configure MySQL hosts for server databases.' }, { to: '/panel/mounts', label: 'Mounts', description: 'Define host → container mount points.' }, { to: '/panel/eggs', label: 'Eggs', description: 'Manage server templates and variables.' }, { to: '/panel/settings', label: 'Settings', description: 'General, mail, and advanced configuration.' }, { to: '/panel/api', label: 'API Keys', description: 'Issue application API credentials.' }, ]; const externalLinks = (version: AdminVersion) => [ { href: version.discord, label: 'Get Help', icon: LifeBuoy }, { href: 'https://pterodactyl.io', label: 'Documentation', icon: BookOpen }, { href: 'https://github.com/pterodactyl/panel', label: 'GitHub', icon: Code2 }, { href: version.donations, label: 'Support Project', icon: HeartHandshake }, ]; export default function OverviewContainer() { const { data: version, error, refetch } = useAdminVersion(); if (error && !version) { return refetch()} />; } return ( {version ? ( <>
{externalLinks(version).map((link) => ( {link.label} ))}
) : ( )}
{sections.map((s) => (

{s.label}

{s.description}

))}
); }