"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _classnames = _interopRequireDefault(require("classnames"));
var _Skeleton = _interopRequireDefault(require("./Skeleton"));
var _constants = require("../../constants");
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

/**
 * Skeleton for text-containing components. Is can be used inside Paragraph, as title, or single text
 * @since 3.28.0
 */
const SkeletonText = _ref => {
  let {
    lines = 3,
    component: Tag = 'span',
    className,
    baseClassName = `${_constants.CLS_PREFIX}skeleton-text`,
    lineProps = {},
    ...props
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, {
    className: (0, _classnames.default)(baseClassName, className),
    ...props,
    children: Array.from({
      length: lines
    }).map((_, key) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default
    // eslint-disable-next-line react/no-array-index-key
    , {
      ...lineProps,
      className: (0, _classnames.default)(`${baseClassName}__line`, lineProps?.className)
    }, key))
  });
};
var _default = exports.default = SkeletonText;