text: import {Checkbox, TableCell, TableHead, TableRow, TableSortLabel} from "@mui/material";
  import Box from "@mui/material/Box";
  import {visuallyHidden} from "@mui/utils";
  import * as PropTypes from "prop-types";
  import React from "react";
  import {useTranslation} from "react-i18next";
  
  export function SortableTableHead(props) {
      const { t, i18n } = useTranslation();
      const { order, orderBy, onRequestSort, headCells } = props;
      const createSortHandler = (property) => (event) => {
          onRequestSort(event, property);
      };
  
      return (
          <TableHead>
              <TableRow>
                  {headCells.map((headCell) => (
                      <TableCell
                          key={headCell.id}
                          align={headCell.numeric ? 'right' : 'left'}
                          padding={headCell.disablePadding ? 'none' : 'normal'}
                          sortDirection={orderBy === headCell.id ? order : false}
                      >
                          <TableSortLabel
                              active={orderBy === headCell.id}
                              direction={orderBy === headCell.id ? order : 'asc'}
                              onClick={createSortHandler(headCell.id)}
                          >
                              {t(headCell.label)}
                              {orderBy === headCell.id ? (
                                  <Box component="span" sx={visuallyHidden}>
                                      {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
                                  </Box>
                              ) : null}
                          </TableSortLabel>
                      </TableCell>
                  ))}
              </TableRow>
          </TableHead>
      );
  }
  
  SortableTableHead.propTypes = {
      onRequestSort: PropTypes.func.isRequired,
      order: PropTypes.oneOf(['asc', 'desc']).isRequired,
      orderBy: PropTypes.string.isRequired,
      headCells: PropTypes.array.isRequired,
  };
  