import type { ReactElement } from 'react'
import { Typography } from '@material-ui/core/'
import CodeBlockTabs from '../../../components/CodeBlockTabs'
type Props = StatusNodeVersionHook
export default function VersionCheck({
isLoading,
isOk,
userVersion,
latestVersion,
latestUrl,
}: Props): ReactElement | null {
if (isLoading) return null
const version = (
User Version
{userVersion}
Latest Version
{latestVersion}
)
// Running latest bee version
if (isOk) {
return (
<>
You are running the latest version of Bee
{version}
>
)
}
// Old version or not connected to bee debug API
return (
<>
Your Bee version is out of date. Please update to the{' '}
latest
{' '}
before continuing. Rerun the installation script below to upgrade. Reference the docs for help with updating.{' '}
Docs
{version}
>
)
}