"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ExportButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _faArrowUpFromBracket = require("@fortawesome/free-solid-svg-icons/faArrowUpFromBracket");
var _button = require("../button");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** An export action indicator. */
const ExportButton = ({
  onExport,
  isDisabled = false,
  testId = 'export-modal-open-button',
  tooltipText,
  exportText,
  tooltipDocsLink = null,
  tooltipPlacement,
  icon = _faArrowUpFromBracket.faArrowUpFromBracket
}) => {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  const exportTextWithDefault = typeof exportText === 'undefined' ? t('Export') : exportText;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
    accentType: exportTextWithDefault ? _button.ACCENT_TYPES.COMMAND : _button.ACCENT_TYPES.GHOST,
    onClick: onExport,
    isDisabled: isDisabled,
    className: "graph-export-button",
    leftIcon: icon,
    testId: testId,
    "aria-label": exportText || t('Export'),
    tooltipText: tooltipText ?? t('Download information related to this visualization'),
    tooltipPlacement: tooltipPlacement,
    tooltipDocsLink: tooltipDocsLink,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: exportTextWithDefault
    })
  });
};
exports.ExportButton = ExportButton;