'use strict';

var Button = require('../../../button/Button.js');
var ProcessIndicator = require('../../../processIndicator/ProcessIndicator.js');
var Title = require('../../../title/Title.js');
var jsxRuntime = require('react/jsx-runtime');
var status = require('../../../common/propsValues/status.js');
var typography = require('../../../common/propsValues/typography.js');

function ProcessingStep({
  isComplete,
  isError,
  isSuccess,
  onAnimationCompleted,
  onClear,
  psButtonText,
  psProcessingText,
  psButtonDisabled
}) {
  let processStatus = status.Status.PROCESSING;
  if (isError) {
    processStatus = status.Status.FAILED;
  }
  if (isSuccess) {
    processStatus = status.Status.SUCCEEDED;
  }
  return /*#__PURE__*/jsxRuntime.jsx("div", {
    className: "droppable-processing-card droppable-card",
    "aria-hidden": isComplete,
    children: /*#__PURE__*/jsxRuntime.jsxs("div", {
      className: "droppable-card-content",
      children: [/*#__PURE__*/jsxRuntime.jsx(ProcessIndicator, {
        status: processStatus,
        onAnimationCompleted: status => onAnimationCompleted(status)
      }), /*#__PURE__*/jsxRuntime.jsx(Title, {
        className: "m-y-2",
        type: typography.Typography.TITLE_BODY,
        "aria-live": "polite",
        children: psProcessingText
      }), psButtonText && /*#__PURE__*/jsxRuntime.jsx(Button, {
        disabled: psButtonDisabled,
        onClick: onClear,
        children: psButtonText
      })]
    })
  });
}

module.exports = ProcessingStep;
//# sourceMappingURL=processingStep.js.map
