import React from 'react';
import { faArrowUpFromBracket } from '@fortawesome/free-solid-svg-icons/faArrowUpFromBracket';
import { Button, ACCENT_TYPES } from '../button';
import { useTranslation } from '../hooks/use-translation';
import { jsx as _jsx } from "react/jsx-runtime";
/** An export action indicator. */
export const ExportButton = ({
  onExport,
  isDisabled = false,
  testId = 'export-modal-open-button',
  tooltipText,
  exportText,
  tooltipDocsLink = null,
  tooltipPlacement,
  icon = faArrowUpFromBracket
}) => {
  const {
    t
  } = useTranslation();
  const exportTextWithDefault = typeof exportText === 'undefined' ? t('Export') : exportText;
  return /*#__PURE__*/_jsx(Button, {
    accentType: exportTextWithDefault ? ACCENT_TYPES.COMMAND : 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__*/_jsx("span", {
      children: exportTextWithDefault
    })
  });
};