@cerberus-design/react
Version:
The Cerberus Design React component library.
35 lines (33 loc) • 842 B
JavaScript
import {
AvatarParts
} from "./chunk-ZZ4JETME.js";
import {
Show
} from "./chunk-NUXMADXV.js";
import {
splitProps
} from "./chunk-BL7G3577.js";
// src/components/avatar/avatar.tsx
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
function Avatar(props) {
const [imgProps, { fallback, children }, rootProps] = splitProps(
props,
["alt", "src"],
["fallback", "children"]
);
return /* @__PURE__ */ jsx(AvatarParts.Root, { ...rootProps, children: /* @__PURE__ */ jsx(
Show,
{
when: children,
fallback: /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(AvatarParts.Fallback, { children: fallback }),
/* @__PURE__ */ jsx(AvatarParts.Image, { ...imgProps })
] }),
children
}
) });
}
export {
Avatar
};
//# sourceMappingURL=chunk-AOLWIMWV.js.map