add buttons
This commit is contained in:
1 parent
9ca79ea793
commit
3fc4160b88
4 files changed
+99
No files matched your search
@@ -3,12 +3,14 @@ import { useTheme } from "@mui/material";
|
||||
import { useState, useMemo } from "react";
|
||||
import { HeaderTeamControls } from "./components/HeaderTeamControls";
|
||||
import { TeamTable } from "./components/TeamTable";
|
||||
import { InviteTeamMemberDialog } from "./components/InviteTeamMemberDialog";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
import type { User, UserRole } from "@/Types/User";
|
||||
|
||||
export const TabTeam = () => {
|
||||
const theme = useTheme();
|
||||
const [filter, setFilter] = useState<UserRole | "">("");
|
||||
const [inviteDialogOpen, setInviteDialogOpen] = useState(false);
|
||||
|
||||
const { data: users } = useGet<User[]>("/auth/users");
|
||||
|
||||
@@ -19,13 +21,21 @@ export const TabTeam = () => {
|
||||
return users.filter((u) => u.role.includes(filter));
|
||||
}, [users, filter]);
|
||||
|
||||
const handleOpenInviteDialog = () => setInviteDialogOpen(true);
|
||||
const handleCloseInviteDialog = () => setInviteDialogOpen(false);
|
||||
|
||||
return (
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<HeaderTeamControls
|
||||
filter={filter}
|
||||
onFilterChange={setFilter}
|
||||
onInviteClick={handleOpenInviteDialog}
|
||||
/>
|
||||
<TeamTable users={filteredUsers} />
|
||||
<InviteTeamMemberDialog
|
||||
open={inviteDialogOpen}
|
||||
onClose={handleCloseInviteDialog}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user