first commit
This commit is contained in:
42
frontend/node_modules/antd/es/skeleton/Paragraph.js
generated
vendored
Normal file
42
frontend/node_modules/antd/es/skeleton/Paragraph.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
const getWidth = (index, props) => {
|
||||
const {
|
||||
width,
|
||||
rows = 2
|
||||
} = props;
|
||||
if (Array.isArray(width)) {
|
||||
return width[index];
|
||||
}
|
||||
// last paragraph
|
||||
if (rows - 1 === index) {
|
||||
return width;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
const Paragraph = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
className,
|
||||
style,
|
||||
rows = 0
|
||||
} = props;
|
||||
const rowList = Array.from({
|
||||
length: rows
|
||||
}).map((_, index) => (
|
||||
/*#__PURE__*/
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
React.createElement("li", {
|
||||
key: index,
|
||||
style: {
|
||||
width: getWidth(index, props)
|
||||
}
|
||||
})));
|
||||
return /*#__PURE__*/React.createElement("ul", {
|
||||
className: classNames(prefixCls, className),
|
||||
style: style
|
||||
}, rowList);
|
||||
};
|
||||
export default Paragraph;
|
||||
Reference in New Issue
Block a user