import{useMemo as r}from"react";import{sortBy as e,reverse as o}from"lodash";import{string as m,shape as t,bool as s}from"prop-types";import a from"../ComparisonRow.js";import{getElementInfo as i}from"./utils.js";import{jsx as u}from"react/jsx-runtime";var n=function(m){var t=m.rowKey,s=m.summaries,n=m.sort,l=m.order,p=m.showBar,y=m.viewMode,d=s.designSummary,w=s.actualSummary,f=s.predictionSummary,c=d&&d[t]||{},v=w&&w[t]||{},K=r((function(){return i({designElements:c,actualElements:v,rowKey:t,predictionSummary:f})}),[c,v,t,f]),M=K.elemMax,h=K.elemAmount,x=n?e(h,n):h;return(x=l&&"desc"===l?o(x):x).map((function(r){return u(a,{rowKey:t,label:r.key,elemKey:r.key,elemMax:M,summaries:s,showBar:p,viewMode:y,unitType:r.unitType},r.key)}))};n.propTypes={rowKey:m,sort:m,order:m,summaries:t,showBar:s,viewMode:m},n.defaultProps={rowKey:"",sort:null,order:null,summaries:{},showBar:!0,viewMode:null};export{n as default};
//# sourceMappingURL=ElementsComparison.js.map
