UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

26 lines (21 loc) 831 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const show = require('../show/show.cjs'); const parts = require('./parts.cjs'); function Avatar(props) { const { alt, src, fallback, children, ...rootProps } = props; const imgProps = { alt, src }; return /* @__PURE__ */ jsxRuntime.jsx(parts.AvatarParts.Root, { ...rootProps, children: /* @__PURE__ */ jsxRuntime.jsx( show.Show, { when: children, fallback: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [ /* @__PURE__ */ jsxRuntime.jsx(parts.AvatarParts.Fallback, { children: fallback }), /* @__PURE__ */ jsxRuntime.jsx(parts.AvatarParts.Image, { ...imgProps }) ] }), children } ) }); } exports.Avatar = Avatar;