"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _faCircleXmark = require("@fortawesome/free-solid-svg-icons/faCircleXmark");
var _button = require("../button");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _tooltip = require("../tooltip");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const DeleteCell = ({
  ariaLabel,
  icon = _faCircleXmark.faCircleXmark,
  onDelete,
  disabled = false,
  tooltip = '',
  testId,
  row
}) => {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
    content: tooltip,
    isDisabled: disabled,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      "test-id": testId,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
        "aria-label": ariaLabel ?? t('Delete'),
        accentType: _button.ACCENT_TYPES.ROUND_ICON,
        onClick: e => {
          e.stopPropagation();
          onDelete(row);
        },
        testId: "delete-button",
        isDisabled: disabled,
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
          icon: icon
        })
      })
    })
  });
};
var _default = exports.default = DeleteCell;