delete state
This commit is contained in:
parent
2d9bdf63fb
commit
b6a27195fe
1 changed files with 13 additions and 0 deletions
|
@ -32,6 +32,10 @@ class Device extends React.Component {
|
|||
.catch((err) => console.error(`Smart plug reset error`, err));
|
||||
}
|
||||
|
||||
deleteState() {
|
||||
this.props.deleteState(this.props.id, this.props.type);
|
||||
}
|
||||
|
||||
renderDeviceComponent() {
|
||||
console.log(JSON.stringify(this.props.stateOrDevice));
|
||||
switch (
|
||||
|
@ -171,6 +175,15 @@ class Device extends React.Component {
|
|||
? this.props.stateOrDevice.name
|
||||
: ""}
|
||||
</Header>
|
||||
<Button
|
||||
color="red"
|
||||
icon
|
||||
onClick={this.deleteState}
|
||||
labelPosition="left"
|
||||
>
|
||||
<Icon name="undo" />
|
||||
Delete
|
||||
</Button>
|
||||
</Grid.Column>
|
||||
)}
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in a new issue