UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

31 lines (26 loc) 1.54 kB
'use client'; 'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const React = require('react'); const cerberus = require('../../context/cerberus.cjs'); const avatar = require('../avatar/avatar.cjs'); function MatchAvatar(props) { const { palette = "page" } = props; const { icons } = cerberus.useCerberusContext(); const { infoNotification: InfoIcon, successNotification: SuccessIcon, warningNotification: WarningIcon, dangerNotification: DangerIcon } = icons; const elRef = React.useRef({ page: /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { gradient: "charon-light", fallback: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, {}), size: "sm" }), info: /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { gradient: "amphiaraus-dark", fallback: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, {}), size: "sm" }), success: /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { gradient: "thanatos-dark", fallback: /* @__PURE__ */ jsxRuntime.jsx(SuccessIcon, {}), size: "sm" }), warning: /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { gradient: "asphodel-light", fallback: /* @__PURE__ */ jsxRuntime.jsx(WarningIcon, {}), size: "sm" }), danger: /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { gradient: "hades-light", fallback: /* @__PURE__ */ jsxRuntime.jsx(DangerIcon, {}), size: "sm" }) }); return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: elRef.current[palette] }); } exports.MatchAvatar = MatchAvatar;