import { ReactElement, useState, useContext } from 'react' import { makeStyles, Theme, createStyles } from '@material-ui/core/styles' import { Alert, AlertTitle } from '@material-ui/lab' import Collapse from '@material-ui/core/Collapse' import IconButton from '@material-ui/core/IconButton' import CloseIcon from '@material-ui/icons/Close' import { Context } from '../providers/Bee' import { SUPPORTED_BEE_VERSION_EXACT } from '@ethersphere/bee-js' const useStyles = makeStyles((theme: Theme) => createStyles({ root: { width: '100%', marginBottom: theme.spacing(2), }, }), ) export default function VersionAlert(): ReactElement | null { const classes = useStyles() const { isLoading, latestUserVersionExact } = useContext(Context) const [open, setOpen] = useState(true) const isExactlySupportedBeeVersion = SUPPORTED_BEE_VERSION_EXACT === latestUserVersionExact if (isLoading || !latestUserVersionExact) return null return (
{ setOpen(false) }} > } > Warning Your Bee node version ({latestUserVersionExact}) does not exactly match the Bee version we tested the Bee Dashboard against ({SUPPORTED_BEE_VERSION_EXACT}). Please note that some functionality may not work properly.
) }