import React from 'react';
import classNames from 'classnames';
import { faRotate } from '@fortawesome/free-solid-svg-icons/faRotate';
import { FontAwesomeIcon } from '../font-awesome-icon';
import { useTranslation } from '../hooks/use-translation';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/** A button that would come in handy in cases when we need to have a control to sync with API */
export const RefreshButton = ({
  className,
  onClick,
  isDisabled = false,
  testId = 'refresh-btn',
  buttonText
}) => {
  const {
    t
  } = useTranslation();
  return /*#__PURE__*/_jsxs("button", {
    className: classNames('button command', className),
    onClick: onClick,
    disabled: isDisabled,
    "test-id": testId,
    type: "button",
    children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
      icon: faRotate
    }), /*#__PURE__*/_jsx("span", {
      children: buttonText ?? t('Refresh')
    })]
  });
};