import React, {Component, useState} from 'react'; import {Button, Checkbox, Form, Modal} from "semantic-ui-react"; const SettingsForm = (props) => { const handleInputChange = e => { const {name, value} = e.target; setValues({...values, [name]: value}) }; const handleCheckboxChange = (e,d) => { const {name, checked} = d; setValues({...values, [name]: checked}) }; const [values, setValues] = useState({name: ''}); return (
{props.type === "smart-plug" ? ( ) : ""}
) } export default class SettingsModal extends Component { constructor(props) { super(props); this.state = { open: true, }; } handleClose = () => { this.setState({open: false}); }; saveSettings = (device) => { // TODO Here there should be all the connections to save the data in the backend console.log("SAVED: ", device); this.props.openModal(); }; render() { const SettingsModal = () => ( Settings of {this.props.device.name} ); return ( ) } }