"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _Skeleton = _interopRequireDefault(require("./Skeleton"));

var _constants = require("../../constants");

// Copyright 1999-2022. 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 = ({
  lines = 3,
  component: Tag = 'span',
  className,
  baseClassName = `${_constants.CLS_PREFIX}skeleton-text`,
  lineProps = {},
  ...props
}) => /*#__PURE__*/_react.default.createElement(Tag, (0, _extends2.default)({
  className: (0, _classnames.default)(baseClassName, className)
}, props), Array.from({
  length: lines
}).map((_, key) => /*#__PURE__*/_react.default.createElement(_Skeleton.default // eslint-disable-next-line react/no-array-index-key
, (0, _extends2.default)({
  key: key
}, lineProps, {
  className: (0, _classnames.default)(`${baseClassName}__line`, lineProps === null || lineProps === void 0 ? void 0 : lineProps.className)
}))));

var _default = SkeletonText;
exports.default = _default;