@carbon/react
Version:
React components for the Carbon Design System
65 lines (63 loc) • 2.24 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { usePrefix } from "../../internal/usePrefix.js";
import classNames from "classnames";
import "react";
import PropTypes from "prop-types";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/StructuredList/StructuredList.Skeleton.tsx
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
function StructuredListSkeleton({ rowCount = 5, className, ...rest }) {
const prefix = usePrefix();
const classNames$1 = classNames(`${prefix}--skeleton`, `${prefix}--structured-list`, className);
const rows = new Array(rowCount).fill(null).map((_, i) => /* @__PURE__ */ jsxs("div", {
className: `${prefix}--structured-list-row`,
children: [
/* @__PURE__ */ jsx("div", { className: `${prefix}--structured-list-td` }),
/* @__PURE__ */ jsx("div", { className: `${prefix}--structured-list-td` }),
/* @__PURE__ */ jsx("div", { className: `${prefix}--structured-list-td` })
]
}, i));
return /* @__PURE__ */ jsxs("div", {
className: classNames$1,
...rest,
children: [/* @__PURE__ */ jsx("div", {
className: `${prefix}--structured-list-thead`,
children: /* @__PURE__ */ jsxs("div", {
className: `${prefix}--structured-list-row ${prefix}--structured-list-row--header-row`,
children: [
/* @__PURE__ */ jsx("div", {
className: `${prefix}--structured-list-th`,
children: /* @__PURE__ */ jsx("span", {})
}),
/* @__PURE__ */ jsx("div", {
className: `${prefix}--structured-list-th`,
children: /* @__PURE__ */ jsx("span", {})
}),
/* @__PURE__ */ jsx("div", {
className: `${prefix}--structured-list-th`,
children: /* @__PURE__ */ jsx("span", {})
})
]
})
}), /* @__PURE__ */ jsx("div", {
className: `${prefix}--structured-list-tbody`,
children: rows
})]
});
}
StructuredListSkeleton.propTypes = {
className: PropTypes.string,
rowCount: PropTypes.number
};
//#endregion
export { StructuredListSkeleton as default };