import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import{jsx as t,jsxs as s,Fragment as i}from"react/jsx-runtime";import n from"classnames";import{Accordion as a,AccordionSummary as o,Box as c,AccordionDetails as l}from"@material-ui/core";import{ExpandMore as m}from"@material-ui/icons";import{useDQUnvalidatedContentStyles as p}from"../styles.js";import{ALERT_STATES as u}from"../constants.js";import{DQAlertTooltip as f}from"./DQAlertTooltip.js";import{DQStatusIcon as d}from"./DQStatusIcon.js";import{getCategoryIconType as y}from"../utils.js";function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,s)}return t}function h(r){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?b(Object(s),!0).forEach((function(t){e(r,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):b(Object(s)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(s,e))}))}return r}var g=function(e){var b=e.assets,g=p({}),j=b.reduce((function(e,t){return e[t.alert.category]||(e[t.alert.category]=[]),e[t.alert.category]=[].concat(r(e[t.alert.category]),[t]),e}),{});return t("div",{children:Object.keys(j).map((function(e){var r=y(j[e]);return s(a,{children:[t(o,{className:n("left",g.categoryName),expandIcon:t(m,{}),children:s(c,{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumnGap:4,width:200,children:[t("span",{children:"".concat(e," (").concat(j[e].length,")")}),t(d,{color:r,iconType:r})]})}),t(l,{children:t("div",{className:g.assetTable,children:j[e].map((function(e){var r=e.id,a=e.name,o=e.issuesNum,c=e.missingNum,l=e.isResolved,m=e.alert,p=e.linkToDQPage,d=function(e){return{alert:m,alertsNum:e===u.issue?o:c,alertState:e===u.issue?u.issue:u.missing,isIssueData:o>0,linkToDQPage:p}},y=d(u.issue),b=d(u.missing);return s("div",{className:g.assetWrapper,children:[t("div",{className:n(g.assetName,g.assetCell),children:a}),l?t("div",{className:g.assetCell,children:t(f,h({},y))}):s(i,{children:[o>0&&t("div",{className:g.assetCell,children:t(f,h({},y))}),c>0&&t("div",{className:g.assetCell,children:t(f,h({},b))})]})]},r)}))})})]},e)}))})};export{g as DQAccordionDetailsContent};
//# sourceMappingURL=DQAccordionDetailsContent.js.map
