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