123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import { AddButton } from "../../common/AddButton";
- import { TableCell, TableRow, TableSortLabel } from "@mui/material";
- import { useNavigate } from "react-router-dom";
- const AdminUserListHeader = ({ onSortChange, sort }) => {
- const navigate = useNavigate();
- return (
- <TableRow className="AdminUserListHeader">
- <TableCell scope="col">
- <TableSortLabel
- active={sort === "_id" || sort === "-_id"}
- direction={sort === "_id" ? "asc" : "desc"}
- onClick={() => onSortChange(sort === "_id" ? "-_id" : "_id")}
- >
- #
- </TableSortLabel>
- </TableCell>
- <TableCell scope="col">Аватар</TableCell>
- <TableCell scope="col">
- <TableSortLabel
- active={sort === "username" || sort === "-username"}
- direction={sort === "username" ? "asc" : "desc"}
- onClick={() => onSortChange(sort === "username" ? "-username" : "username")}
- >
- Username
- </TableSortLabel>
- </TableCell>
- <TableCell scope="col">
- <TableSortLabel
- active={sort === "is_active" || sort === "-is_active"}
- direction={sort === "is_active" ? "asc" : "desc"}
- onClick={() => onSortChange(sort === "is_active" ? "-is_active" : "is_active")}
- >
- Активний
- </TableSortLabel>
- </TableCell>
- <TableCell scope="col">
- <TableSortLabel
- active={sort === "is_superuser" || sort === "-is_superuser"}
- direction={sort === "is_superuser" ? "asc" : "desc"}
- onClick={() => onSortChange(sort === "is_superuser" ? "-is_superuser" : "is_superuser")}
- >
- Адміністратор
- </TableSortLabel>
- </TableCell>
- <TableCell scope="col">
- <AddButton
- onClick={() => {
- navigate("/admin/user/");
- }}
- />
- </TableCell>
- </TableRow>
- );
- };
- export { AdminUserListHeader };
|