UNPKG

@ultraviolet/illustrations

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