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