import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import React from 'react';
import classNames from 'classnames';

var Paragraph = function Paragraph(props) {
  var prefixCls = props.prefixCls,
      className = props.className,
      _props$rows = props.rows,
      rows = _props$rows === void 0 ? 2 : _props$rows,
      width = props.width,
      style = props.style;

  var getWidth = function getWidth(index) {
    if (Array.isArray(width)) {
      return width[index];
    }

    if (rows - 1 === index) {
      return width;
    }

    return undefined;
  };

  var rowList = _toConsumableArray(Array(rows)).map(function (_, index) {
    return /*#__PURE__*/React.createElement("li", {
      key: index,
      style: {
        width: getWidth(index)
      }
    });
  });

  return /*#__PURE__*/React.createElement("ul", {
    className: classNames(prefixCls, className),
    style: style
  }, rowList);
};

export default Paragraph;