TableEditableHead.tsx 901 B

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