// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

import classNames from 'classnames';
import Skeleton from './Skeleton';
import { CLS_PREFIX } from '../../constants';
import { jsx as _jsx } from "react/jsx-runtime";
/**
 * 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 = `${CLS_PREFIX}skeleton-text`,
    lineProps = {},
    ...props
  } = _ref;
  return /*#__PURE__*/_jsx(Tag, {
    className: classNames(baseClassName, className),
    ...props,
    children: Array.from({
      length: lines
    }).map((_, key) => /*#__PURE__*/_jsx(Skeleton
    // eslint-disable-next-line react/no-array-index-key
    , {
      ...lineProps,
      className: classNames(`${baseClassName}__line`, lineProps?.className)
    }, key))
  });
};
export default SkeletonText;