import React from 'react';
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons/faCircleXmark';
import { Button, ACCENT_TYPES } from '../button';
import { FontAwesomeIcon } from '../font-awesome-icon';
import { Tooltip } from '../tooltip';
import { useTranslation } from '../hooks/use-translation';
import { jsx as _jsx } from "react/jsx-runtime";
const DeleteCell = ({
  ariaLabel,
  icon = faCircleXmark,
  onDelete,
  disabled = false,
  tooltip = '',
  testId,
  row
}) => {
  const {
    t
  } = useTranslation();
  return /*#__PURE__*/_jsx(Tooltip, {
    content: tooltip,
    isDisabled: disabled,
    children: /*#__PURE__*/_jsx("span", {
      "test-id": testId,
      children: /*#__PURE__*/_jsx(Button, {
        "aria-label": ariaLabel ?? t('Delete'),
        accentType: ACCENT_TYPES.ROUND_ICON,
        onClick: e => {
          e.stopPropagation();
          onDelete(row);
        },
        testId: "delete-button",
        isDisabled: disabled,
        children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
          icon: icon
        })
      })
    })
  });
};
export default DeleteCell;