import React, { useState } from 'react'; import t from '../common/localization'; import EditItemView from '../EditItemView'; import { Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography, TextField, FormControl, InputLabel, MenuItem, Select, } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import EditAttributesView from '../attributes/EditAttributesView'; import positionAttributes from '../attributes/positionAttributes'; const useStyles = makeStyles(() => ({ details: { flexDirection: 'column', }, })); const MaintenancePage = () => { const classes = useStyles(); const [item, setItem] = useState(); const options = []; Object.entries(positionAttributes).map(([key, value]) => { if (value.type === 'number') { options.push({ key, name: value.name, type: value.type }) } }); const handleChange = event => { const newValue = event.target.value; setItem({...item, type: newValue}); } return ( {item && <> }> {t('sharedRequired')} setItem({...item, name: event.target.value})} label={t('sharedName')} variant="filled" /> {t('sharedType')} setItem({...item, start: event.target.value})} label={t('maintenanceStart')} variant="filled" /> setItem({...item, period: event.target.value})} label={t('maintenancePeriod')} variant="filled" /> }> {t('sharedAttributes')} setItem({...item, attributes})} definitions={{}} /> } ); } export default MaintenancePage;