import React from "react";
import useGroups from "../Hooks/group";
import Loading from "./Groups";
import LGroup from "./LGroup";
import {Row} from "reactstrap";

function LGroups() {
  const groups = useGroups();

  if (groups === null) {
    return <Loading/>;
  }

  return (
    <Row>
      {groups.map(group => <LGroup key={group.id} {...group} />)}
    </Row>
  );
}

export default LGroups;
