UNPKG

@ultraviolet/illustrations

Version:
19 lines (18 loc) 496 B
import { jsx } from "@emotion/react/jsx-runtime"; import { useTheme } from "@emotion/react"; import { ILLUSTRATIONS } from "./Illustrations.js"; const DynamicIllustration = ({ name, width, height, "data-testid": dataTestId, className }) => { const { theme } = useTheme(); return /* @__PURE__ */ jsx("img", { className, "data-testid": dataTestId, src: ILLUSTRATIONS[theme === "light" ? "light" : "dark"][name], alt: name, width, height }); }; export { DynamicIllustration };