UNPKG

@heroui/avatar

Version:

The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon.

39 lines (36 loc) 1 kB
"use client"; import { avatar_default } from "./chunk-CV4BWJDJ.mjs"; import { useAvatarGroup } from "./chunk-R5FIEVLT.mjs"; import { AvatarGroupProvider } from "./chunk-JUJ53SJZ.mjs"; // src/avatar-group.tsx import { forwardRef } from "@heroui/system"; import { jsx, jsxs } from "react/jsx-runtime"; var AvatarGroup = forwardRef((props, ref) => { const { Component, clones, context, remainingCount, getAvatarGroupCountProps, getAvatarGroupProps, renderCount = (count) => /* @__PURE__ */ jsx(avatar_default, { ...getAvatarGroupCountProps(), name: `+${count}` }) } = useAvatarGroup({ ...props, ref }); return /* @__PURE__ */ jsx(Component, { ...getAvatarGroupProps(), children: /* @__PURE__ */ jsxs(AvatarGroupProvider, { value: context, children: [ clones, remainingCount > 0 && renderCount(remainingCount) ] }) }); }); AvatarGroup.displayName = "HeroUI.AvatarGroup"; var avatar_group_default = AvatarGroup; export { avatar_group_default };