import t from"@babel/runtime/helpers/toArray";import e from"prop-types";import{isEmpty as r}from"lodash";import{makeStyles as i,Chip as n,Tooltip as a}from"@material-ui/core";import l from"../TruncatedText/index.js";import{jsxs as o,Fragment as m,jsx as c}from"react/jsx-runtime";var s=i({assetsCount:{maxWidth:168,whiteSpace:"nowrap"},countChip:{marginLeft:8}}),p=function(e){var i=e.items,p=e.limit,u=s(),d=t(i),h=d[0],f=d.slice(1);return r(i)?null:o(m,{children:[c(n,{label:c("div",{className:u.assetsCount,children:c(l,{children:h})})}),i.length>1&&c(a,{title:c("div",{children:f.map((function(t,e){return o("div",{children:[t,"".concat(e<f.length-1?",":"")]},t)}))}),children:c(n,{label:i.length<=p?"+".concat(i.length-1):"".concat(p-1,"+"),className:u.countChip})})]})};p.propTypes={items:e.arrayOf(e.string).isRequired,limit:e.number},p.defaultProps={limit:100};export{p as default};
