"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.RefreshButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _faRotate = require("@fortawesome/free-solid-svg-icons/faRotate");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** A button that would come in handy in cases when we need to have a control to sync with API */
const RefreshButton = ({
  className,
  onClick,
  isDisabled = false,
  testId = 'refresh-btn',
  buttonText
}) => {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
    className: (0, _classnames.default)('button command', className),
    onClick: onClick,
    disabled: isDisabled,
    "test-id": testId,
    type: "button",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: _faRotate.faRotate
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: buttonText ?? t('Refresh')
    })]
  });
};
exports.RefreshButton = RefreshButton;