import React, { useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { Link, useNavigate } from "react-router-dom"; import { Button, Card } from "react-bootstrap"; import PropTypes from "prop-types"; const CreateGroup = (props) => { const [groupName, setGroupName] = useState(""), [errorAlert, setErrorAlert] = useState(null), limit = useSelector((state) => state.limit); const dispatch = useDispatch(); const navigate = useNavigate(); const dispatchPageUpdate = (data, page) => { dispatch({ type: "GROUPS_PAGE", value: { data: data, page: page, }, }); }; const { createGroup, updateGroups } = props; return ( <>
{errorAlert != null ? (
{errorAlert}
) : ( <> )}

Create Group

{ setGroupName(e.target.value.trim()); }} >
); }; CreateGroup.propTypes = { createGroup: PropTypes.func, updateGroups: PropTypes.func, }; export default CreateGroup;