import ExternalLink from '../../../../common/components/link/external-link/ExternalLink'; import useAppVersion from '../../../../common/hooks-query/useAppVersion'; import { appVersion } from '../../../../externals'; import * as Panel from '../../panel-utils/PanelUtils'; export default function AppVersion() { const { data, isError } = useAppVersion(); if (isError) { return ( {`You are currently using Ontime version ${appVersion}`} {`Could not fetch version information: ${isError}`} ); } if (data.hasUpdates) { return ( <> {`You are currently using Ontime version ${appVersion}.`} {`A new version ${data.version} is available.`} Please visit the release page to download ); } return {`You are currently using the latest version of Ontime: ${appVersion}`}; }