import React, { useEffect, useState } from 'react'; import tw from 'twin.macro'; import useFlash from '@/plugins/useFlash'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import FlashMessageRender from '@/components/FlashMessageRender'; import Spinner from '@/components/elements/Spinner'; import getVersion, { VersionData } from '@/api/admin/getVersion'; const Code = ({ children }: { children: React.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}.

}
}
); };