import React, { ReactElement, useState } from 'react' import { TextField, Button, CircularProgress, Container } from '@material-ui/core' interface Props { defaultHost?: string hostName: string } export default function ConnectToHost(props: Props): ReactElement { const [hostInputVisible, toggleHostInputVisibility] = useState(false) const [connectingToHost, setConnectingToHost] = useState(false) const [host, setHost] = useState('') const handleNewHostConnection = () => { if (host) { setConnectingToHost(true) sessionStorage.setItem(props.hostName, host) toggleHostInputVisibility(!hostInputVisible) window.location.reload() } } return (