TableEditableHead.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { FC } from 'react';
  2. import TableHead from '@mui/material/TableHead';
  3. import TableRow from '@mui/material/TableRow';
  4. import TableCell from '@mui/material/TableCell';
  5. import { makeStyles } from '@mui/styles';
  6. import type { Theme } from '@mui/material/styles';
  7. import type { TableEditableHeadType } from './Types';
  8. const useStyles = makeStyles((theme: Theme) => ({
  9. tableCell: {
  10. paddingLeft: theme.spacing(2),
  11. },
  12. tableHeader: {
  13. textTransform: 'capitalize',
  14. color: 'rgba(0, 0, 0, 0.6)',
  15. fontSize: '12.8px',
  16. },
  17. tableRow: {
  18. // borderBottom: '1px solid rgba(0, 0, 0, 0.6);',
  19. },
  20. }));
  21. const EditableTableHead: FC<TableEditableHeadType> = props => {
  22. const { editHeads } = props;
  23. const classes = useStyles();
  24. return (
  25. <TableHead>
  26. <TableRow className={classes.tableRow}>
  27. {editHeads.map((headCell, index) => (
  28. <TableCell key={index} className={classes.tableCell}>
  29. {headCell.component}
  30. </TableCell>
  31. ))}
  32. </TableRow>
  33. </TableHead>
  34. );
  35. };
  36. export default EditableTableHead;