UNPKG

@carbon/react

Version:

React components for the Carbon Design System

55 lines (53 loc) 1.66 kB
/** * 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/CodeSnippet/CodeSnippet.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 CodeSnippetSkeleton({ className: containerClassName, type = "single", ...rest }) { const prefix = usePrefix(); const className = classNames(containerClassName, { [`${prefix}--snippet`]: true, [`${prefix}--skeleton`]: true, [`${prefix}--snippet--single`]: type === "single", [`${prefix}--snippet--multi`]: type === "multi" }); if (type === "single") return /* @__PURE__ */ jsx("div", { className, ...rest, children: /* @__PURE__ */ jsx("div", { className: `${prefix}--snippet-container`, children: /* @__PURE__ */ jsx("span", {}) }) }); if (type === "multi") return /* @__PURE__ */ jsx("div", { className, ...rest, children: /* @__PURE__ */ jsxs("div", { className: `${prefix}--snippet-container`, children: [ /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsx("span", {}) ] }) }); } CodeSnippetSkeleton.propTypes = { className: PropTypes.string, type: PropTypes.oneOf(["single", "multi"]) }; //#endregion export { CodeSnippetSkeleton as default };