import Typography from "@mui/material/Typography"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { Table } from "@/Components/v2/design-elements"; import type { Header } from "@/Components/v2/design-elements/Table"; import { useIsSuperAdmin } from "@/Hooks/useIsAdmin"; import type { User } from "@/Types/User"; interface TeamTableProps { users: User[]; } export const TeamTable = ({ users }: TeamTableProps) => { const { t } = useTranslation(); const navigate = useNavigate(); const isSuperAdmin = useIsSuperAdmin(); const headers: Header[] = [ { id: "name", content: t("common.table.headers.name"), render: (row) => {`${row.firstName} ${row.lastName}`}, }, { id: "email", content: t("pages.account.team.table.headers.email"), render: (row) => {row.email}, }, { id: "role", content: t("pages.account.team.table.headers.role"), render: (row) => ( {row.role.map((r) => t(`common.auth.roles.${r}`)).join(", ")} ), }, ]; const handleRowClick = (row: User) => { if (isSuperAdmin) { navigate(`/account/team/${row.id}`); } }; return ( ); };