"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LoadingIcon = void 0;
var _react = _interopRequireDefault(require("react"));
var _message = require("../message");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** Loading Icon inform users about the status of ongoing processes,
 * such as loading an app,
 * submitting a form, or saving updates.
 * ***Notes: For correct centering loader icon should have a parent with
 * "display: flex" style
 * @midnight-gray-supported
 */

const LoadingIcon = ({
  message,
  id = '',
  testId = '',
  className
}) => {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_message.Message, {
    className: className,
    type: _message.MESSAGE_TYPES.IN_PROGRESS,
    id: id,
    testId: testId,
    isCentered: true,
    children: message ?? t('Loading...')
  });
};
exports.LoadingIcon = LoadingIcon;