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