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