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.
29 lines
817 B
29 lines
817 B
import React from "react";
|
|
import {Button, Card, CardBody, CardFooter, CardHeader, ListGroup} from "reactstrap";
|
|
import useLights from "../Hooks/light";
|
|
import Light from "./Light";
|
|
import Loading from "./Loading";
|
|
|
|
function Group({id, name}) {
|
|
const lights = useLights({groupId: id});
|
|
|
|
return (
|
|
<Card className="mt-3">
|
|
<CardHeader>{name}</CardHeader>
|
|
<CardBody>
|
|
{lights !== null
|
|
? <ListGroup>{lights.map(light => <Light key={light.id} {...light} />)}</ListGroup>
|
|
: <Loading/>}
|
|
</CardBody>
|
|
<CardFooter>
|
|
<Button color="primary">Detaljer</Button>
|
|
{" "}
|
|
<Button color="secondary">Skift farger</Button>
|
|
{" "}
|
|
{id > 0 && <Button color="danger">Fjern</Button>}
|
|
</CardFooter>
|
|
</Card>
|
|
);
|
|
}
|
|
|
|
export default Group;
|