import React, { Component, useState } from "react"; import { Button, Checkbox, Form, Icon, Header, Modal } from "semantic-ui-react"; const DeleteModal = (props) => ( Remove} closeIcon>
); 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" ? ( ) : ( "" )} props.removeDevice(values)} />
); }; 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); if (device.name.length > 0) { this.props.updateDevice(device); } this.props.openModal(); }; render() { const SettingsModal = () => ( Settings of {this.props.device.name} ); return ; } }