import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogTitle from '@material-ui/core/DialogTitle'; import TextField from '@material-ui/core/TextField'; import Tooltip from '@material-ui/core/Tooltip'; import React, {Component} from 'react'; interface IProps { fClose: VoidFunction; fOnSubmit: (name: string) => void; } export default class AddDialog extends Component { public state = {name: ''}; public render() { const {fClose, fOnSubmit} = this.props; const {name} = this.state; const submitEnabled = this.state.name.length !== 0; const submitAndClose = () => { fOnSubmit(name); fClose(); }; return ( Create a client
); } private handleChange(propertyName: string, event: React.ChangeEvent) { const state = this.state; state[propertyName] = event.target.value; this.setState(state); } }