UNPKG

@carbon/ibm-products

Version:
44 lines (42 loc) 1.78 kB
/** * Copyright IBM Corp. 2020, 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 React, { Suspense, lazy } from "react"; import PropTypes from "prop-types"; //#region src/components/EmptyStates/EmptyStateIllustration.deprecated.jsx /** * Copyright IBM Corp. 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ const ErrorIllustration = lazy(() => import("./assets/ErrorIllustration.js")); const NoDataIllustration = lazy(() => import("./assets/NoDataIllustration.js")); const NoTagsIllustration = lazy(() => import("./assets/NoTagsIllustration.js")); const NotFoundIllustration = lazy(() => import("./assets/NotFoundIllustration.js")); const NotificationsIllustration = lazy(() => import("./assets/NotificationsIllustration.js")); const UnauthorizedIllustration = lazy(() => import("./assets/UnauthorizedIllustration.js")); const getIllustration = (kind) => { switch (kind) { case "error": return ErrorIllustration; case "noData": return NoDataIllustration; case "noTags": return NoTagsIllustration; case "notifications": return NotificationsIllustration; case "notFound": return NotFoundIllustration; case "unauthorized": return UnauthorizedIllustration; default: return () => null; } }; const EmptyStateIllustration = ({ kind, ...rest }) => { const Illustration = getIllustration(kind); return /* @__PURE__ */ React.createElement(Suspense, null, /* @__PURE__ */ React.createElement(Illustration, { "aria-hidden": "true", ...rest })); }; EmptyStateIllustration.propTypes = { kind: PropTypes.string }; //#endregion export { EmptyStateIllustration as default };