import React from 'react'; import {Segment, Input, Form} from 'semantic-ui-react'; import UnitLeone from './UnitLeone'; import UnitDigitalInput from './UnitDigitalInput'; import UnitTime from './UnitTime'; import UnitGroups from './UnitGroups'; import UnitModbus from './UnitModbus'; class Unit extends React.Component { handleChangeUnit = (val) => { this.props.changeUnitType(this.props.id, val); } getUnitComponent = () => { let {data, ops, i18n, showDialog, toggleLoading, groups} = this.props; switch(data.unit){ case 'leone': return case 'di': return case 'modbus': return case 'time': return case 'unit': return default: return null; } } updateData = (data) => { console.log(data); this.props.updateData(this.props.id, data); } render() { let {ops, id} = this.props; return ( {this.getUnitComponent()} ) } } export default Unit;