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.

43 lines
1.2 KiB

  1. import React, {useState} from "react";
  2. import {Button, Col, Form, FormGroup, Input, Label, Modal, ModalBody, ModalFooter, ModalHeader} from "reactstrap";
  3. import {addGroup} from "../../Helpers/groups";
  4. function GroupAddModal({onClose}) {
  5. const [name, setName] = useState("");
  6. return (
  7. <Modal isOpen={true}>
  8. <ModalHeader>Ny gruppe</ModalHeader>
  9. <ModalBody style={{margin: "0 auto"}}>
  10. <Form>
  11. <FormGroup row>
  12. <Label sm={3} for="text-name">
  13. Navn:
  14. </Label>
  15. <Col sm={9}>
  16. <Input type="text"
  17. id="text-name"
  18. name="power"
  19. value={name}
  20. onChange={e => setName(e.target.value)}/>
  21. </Col>
  22. </FormGroup>
  23. </Form>
  24. </ModalBody>
  25. <ModalFooter>
  26. <Button color="primary"
  27. onClick={() => {
  28. addGroup(name);
  29. onClose();
  30. }}
  31. >
  32. Lagre
  33. </Button>
  34. {" "}
  35. <Button color="secondary" onClick={onClose}>Avbryt</Button>
  36. </ModalFooter>
  37. </Modal>
  38. );
  39. }
  40. export default GroupAddModal;