The main server, and probably only repository in this org.
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

5 years ago
  1. import React, {useState} from "react";
  2. import {Button, FormGroup} from "reactstrap";
  3. import useBridges from "../Hooks/bridge";
  4. function BridgeLight({ id, bridgeId, name }) {
  5. const [waiting, setWaiting] = useState(false);
  6. const {forgetLight} = useBridges();
  7. function forget() {
  8. setWaiting(true);
  9. forgetLight(bridgeId, id);
  10. }
  11. return (
  12. <FormGroup>
  13. <Button color="danger" size="sm" disabled={waiting} onClick={forget}>Glem</Button>
  14. {" "}
  15. {name}
  16. </FormGroup>
  17. );
  18. }
  19. export default BridgeLight;