import t,{useCallback as o,useMemo as r}from"react";import e from"classnames";import{Flex as a}from"@vibe/layout/mockedClassNames";import n from"./AvatarGroupCounterTooltipContentVirtualizedList.js";import{avatarRenderer as i}from"./AvatarGroupCounterTooltipHelper.js";import l from"./AvatarGroupCounterTooltipContent.module.scss.js";var s=function(s){var p=s.avatars,u=void 0===p?[]:p,m=s.type,c=s.className,v=s.isVirtualizedList,d=void 0!==v&&v,C=s.tooltipContentContainerRef,f=o((function(t){var o;return(null===(o=null==t?void 0:t.tooltipProps)||void 0===o?void 0:o.content)||(null==t?void 0:t.ariaLabel)}),[]),b=r((function(){var t=u.map((function(t){return{value:Object.assign(Object.assign({},t.props),{tooltipContent:f(t.props)})}})),o=!t.some((function(t){return t.value.tooltipContent})),r=o?void 0:t.map((function(t){return t.value.tooltipContent})).join(",");return{avatarItems:t,displayAsGrid:o,tooltipContainerAriaLabel:r}}),[u,f]),L=b.avatarItems,A=b.displayAsGrid,g=b.tooltipContainerAriaLabel,j=r((function(){return L.map((function(t,o){return i(t,o,void 0,m,A)}))}),[L,A,m]);if(d)return t.createElement(n,{avatarRenderer:i,tooltipContentContainerRef:C,tooltipContainerAriaLabel:g,avatarItems:L,type:m});var G={ref:C,tabIndex:-1,role:"treegrid",ariaLabel:g,className:A?e(l.scrollableContainer,l.tooltipContainer,l.tooltipGridContainer,c):e(l.scrollableContainer,l.tooltipContainer,c),direction:A?a.directions.ROW:a.directions.COLUMN,gap:A?a.gaps.XS:a.gaps.SMALL,wrap:A};return t.createElement(a,Object.assign({},G),j)};export{s as default};
//# sourceMappingURL=AvatarGroupCounterTooltipContent.js.map
