import ExternalLink from '../../../../common/components/link/external-link/ExternalLink';
import useAppVersion from '../../../../common/hooks-query/useAppVersion';
import { appVersion, isOntimeCloud } 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
);
}
if (data.hasUpdates) {
return (
{`You are currently using Ontime version ${appVersion}.`}
{`A new version ${data.version} is available.`}
{isOntimeCloud ? (
'You can restart your stage to get the latest available version.'
) : (
Please visit the release page to download
)}
);
}
return {`You are currently using the latest version of Ontime: ${appVersion}`};
}