You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
537 B
23 lines
537 B
import React, {useState} from "react";
|
|
import {Button, FormGroup} from "reactstrap";
|
|
import useBridges from "../Hooks/bridge";
|
|
|
|
function BridgeLight({ id, bridgeId, name }) {
|
|
const [waiting, setWaiting] = useState(false);
|
|
const {forgetLight} = useBridges();
|
|
|
|
function forget() {
|
|
setWaiting(true);
|
|
forgetLight(bridgeId, id);
|
|
}
|
|
|
|
return (
|
|
<FormGroup>
|
|
<Button color="danger" size="sm" disabled={waiting} onClick={forget}>Glem</Button>
|
|
{" "}
|
|
{name}
|
|
</FormGroup>
|
|
);
|
|
}
|
|
|
|
export default BridgeLight;
|