@cerberus-design/react
Version:
The Cerberus Design React component library.
33 lines (31 loc) • 1.34 kB
JavaScript
import {
Avatar
} from "./chunk-AOLWIMWV.js";
import {
useCerberusContext
} from "./chunk-GITT5645.js";
// src/components/admonition/match-avatar.tsx
import { useRef } from "react";
import { Fragment, jsx } from "react/jsx-runtime";
function MatchAvatar(props) {
const { palette = "page" } = props;
const { icons } = useCerberusContext();
const {
infoNotification: InfoIcon,
successNotification: SuccessIcon,
warningNotification: WarningIcon,
dangerNotification: DangerIcon
} = icons;
const elRef = useRef({
page: /* @__PURE__ */ jsx(Avatar, { gradient: "charon-light", fallback: /* @__PURE__ */ jsx(InfoIcon, {}), size: "sm" }),
info: /* @__PURE__ */ jsx(Avatar, { gradient: "amphiaraus-dark", fallback: /* @__PURE__ */ jsx(InfoIcon, {}), size: "sm" }),
success: /* @__PURE__ */ jsx(Avatar, { gradient: "thanatos-dark", fallback: /* @__PURE__ */ jsx(SuccessIcon, {}), size: "sm" }),
warning: /* @__PURE__ */ jsx(Avatar, { gradient: "asphodel-light", fallback: /* @__PURE__ */ jsx(WarningIcon, {}), size: "sm" }),
danger: /* @__PURE__ */ jsx(Avatar, { gradient: "hades-light", fallback: /* @__PURE__ */ jsx(DangerIcon, {}), size: "sm" })
});
return /* @__PURE__ */ jsx(Fragment, { children: elRef.current[palette] });
}
export {
MatchAvatar
};
//# sourceMappingURL=chunk-3NPWHL5X.js.map