import type { ReactNode } from 'react'; import { useEffect, useState } from 'react'; import tw from 'twin.macro'; import type { VersionData } from '@/api/admin/getVersion'; import getVersion from '@/api/admin/getVersion'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import FlashMessageRender from '@/components/FlashMessageRender'; import Spinner from '@/components/elements/Spinner'; import useFlash from '@/plugins/useFlash'; const Code = ({ children }: { children: ReactNode }) => { return ( {children} ); }; export default () => { const { clearFlashes, clearAndAddHttpError } = useFlash(); const [loading, setLoading] = useState(true); const [versionData, setVersionData] = useState(undefined); useEffect(() => { clearFlashes('overview'); getVersion() .then(versionData => setVersionData(versionData)) .catch(error => { console.error(error); clearAndAddHttpError({ key: 'overview', error }); }) .then(() => setLoading(false)); }, []); return (

Overview

A quick glance at your system.

{loading ? (
) : (

System Information

{versionData?.panel.current === 'canary' ? (

I hope you enjoy living on the edge because you are running a{' '} {versionData?.panel.current} version of Pterodactyl.

) : versionData?.panel.latest === versionData?.panel.current ? (

Your panel is up-to-date. The latest version is {versionData?.panel.latest} and you are running version{' '} {versionData?.panel.current}.

) : (

Your panel is not up-to-date. The latest version is {versionData?.panel.latest} and you are running version{' '} {versionData?.panel.current}.

)}
)}
); };