"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),r=require("classnames"),t=require("@material-ui/core"),a=require("@material-ui/icons"),i=require("../styles.js"),n=require("../constants.js"),l=require("./DQAlertTooltip.js"),c=require("./DQStatusIcon.js"),o=require("../utils.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(r);exports.DQAccordionDetailsContent=function(r){var u=r.assets,j=i.useDQUnvalidatedContentStyles({}),m=u.reduce((function(s,r){return s[r.alert.category]||(s[r.alert.category]=[]),s[r.alert.category]=e.__spreadArray(e.__spreadArray([],s[r.alert.category],!0),[r],!1),s}),{});return s.jsx("div",{children:Object.keys(m).map((function(r){var i=o.getCategoryIconType(m[r]);return s.jsxs(t.Accordion,{children:[s.jsx(t.AccordionSummary,{className:d.default("left",j.categoryName),expandIcon:s.jsx(a.ExpandMore,{}),children:s.jsxs(t.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumnGap:4,width:200,children:[s.jsx("span",{children:"".concat(r," (").concat(m[r].length,")")}),s.jsx(c.DQStatusIcon,{color:i,iconType:i})]})}),s.jsx(t.AccordionDetails,{children:s.jsx("div",{className:j.assetTable,children:m[r].map((function(r){var t=r.id,a=r.name,i=r.issuesNum,c=r.missingNum,o=r.isResolved,u=r.alert,m=r.linkToDQPage,T=function(e){return{alert:u,alertsNum:e===n.ALERT_STATES.issue?i:c,alertState:e===n.ALERT_STATES.issue?n.ALERT_STATES.issue:n.ALERT_STATES.missing,isIssueData:i>0,linkToDQPage:m}},x=T(n.ALERT_STATES.issue),p=T(n.ALERT_STATES.missing);return s.jsxs("div",{className:j.assetWrapper,children:[s.jsx("div",{className:d.default(j.assetName,j.assetCell),children:a}),o?s.jsx("div",{className:j.assetCell,children:s.jsx(l.DQAlertTooltip,e.__assign({},x))}):s.jsxs(s.Fragment,{children:[i>0&&s.jsx("div",{className:j.assetCell,children:s.jsx(l.DQAlertTooltip,e.__assign({},x))}),c>0&&s.jsx("div",{className:j.assetCell,children:s.jsx(l.DQAlertTooltip,e.__assign({},p))})]})]},t)}))})})]},r)}))})};
