import { FC } from 'react';

import DeleteIcon from '@material-hu/icons/material/Delete';
import IconButton from '@material-hu/mui/IconButton';
import TableCell from '@material-hu/mui/TableCell';
import Tooltip from '@material-hu/mui/Tooltip';

export type DeleteEmployeeTableProps = {
  title: string;
  onDelete: () => void;
};

export const DeleteEmployeeTable: FC<DeleteEmployeeTableProps> = props => {
  const { title, onDelete } = props;

  return (
    <TableCell>
      <Tooltip
        title={title}
        placement="top"
      >
        <IconButton onClick={onDelete}>
          <DeleteIcon sx={{ color: 'red' }} />
        </IconButton>
      </Tooltip>
    </TableCell>
  );
};

export default DeleteEmployeeTable;
