import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import Button from 'material-ui/Button'; import { LinearProgress } from 'material-ui/Progress'; import Typography from 'material-ui/Typography'; import { MenuItem } from 'material-ui/Menu'; import { TextValidator, ValidatorForm, SelectValidator } from 'react-material-ui-form-validator'; import {isAPEnabled} from '../constants/WiFiAPModes'; const styles = theme => ({ loadingSettings: { margin: theme.spacing.unit, }, loadingSettingsDetails: { margin: theme.spacing.unit * 4, textAlign: "center" }, textField: { width: "100%" }, selectField:{ width: "100%", marginTop: theme.spacing.unit * 2, marginBottom: theme.spacing.unit }, button: { marginRight: theme.spacing.unit * 2, marginTop: theme.spacing.unit * 2, } }); class APSettingsForm extends React.Component { render() { const { classes, apSettingsFetched, apSettings, errorMessage, handleValueChange, onSubmit, onReset } = this.props; return (
{ !apSettingsFetched ?
Loading...
: apSettings ? Always When WiFi Disconnected Never { isAPEnabled(apSettings.provision_mode) && } :
{errorMessage}
}
); } } APSettingsForm.propTypes = { classes: PropTypes.object.isRequired, apSettingsFetched: PropTypes.bool.isRequired, apSettings: PropTypes.object, errorMessage: PropTypes.string, onSubmit: PropTypes.func.isRequired, onReset: PropTypes.func.isRequired, handleValueChange: PropTypes.func.isRequired }; export default withStyles(styles)(APSettingsForm);