(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7890],{50755:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-discovery/action-center/infrastructure/[monitorId]",function(){return l(94800)}])},94800:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return y}});var a=l(24246),n=l(86677),i=l(35287),s=l(77830),o=l(58754),r=l(39158),c=l(25415),u=l(30952),d=l(27378),m=l(8125),v=l(70675),h=l(71985),_=l(88708),b=l(66213);let p=function(){let{rowClickUrl:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{columns:(0,d.useMemo)(()=>(0,b.b$)({rowClickUrl:e}),[e])}},f=e=>{let{monitorId:t}=e,l=(0,m.o)({sorting:{validColumns:["name"]}}),{pageIndex:n,pageSize:i,searchQuery:o,updateSearch:c,resetState:u}=l,b=(0,_.Z)(),{data:f,isLoading:g,isFetching:y}=(0,v.QP)({monitor_config_key:t,page:n,size:i,search:o}),j=(0,d.useMemo)(()=>{if(null==f?void 0:f.items)return{...f,items:f.items.map(e=>{var t,l,a,n,i,s;return{id:e.urn,name:null!==(t=e.name)&&void 0!==t?t:null,system_key:null!==(l=e.system_key)&&void 0!==l?l:null,data_uses:null!==(a=e.data_uses)&&void 0!==a?a:[],vendor_id:null!==(n=e.vendor_id)&&void 0!==n?n:null,total_updates:1,locations:null!==(i=e.locations)&&void 0!==i?i:[],domains:e.domain?[e.domain]:[],consent_status:null,metadata:null!==(s=e.metadata)&&void 0!==s?s:null}})}},[f]),w=(0,d.useCallback)(e=>{var t,l,a;return null!==(a=null!==(l=null!==(t=e.id)&&void 0!==t?t:e.vendor_id)&&void 0!==l?l:e.name)&&void 0!==a?a:s.Kl},[]),k=(0,d.useMemo)(()=>({enableSelection:!0,getRowKey:w,isLoading:g,isFetching:y,dataSource:(null==j?void 0:j.items)||[],totalRows:(null==j?void 0:j.total)||0,customTableProps:{locale:{emptyText:(0,a.jsx)(r.oj8,{image:r.oj8.PRESENTED_IMAGE_SIMPLE,description:"All caught up!"})}}}),[w,g,y,null==j?void 0:j.items,null==j?void 0:j.total]),x=(0,m.V)(l,k),{selectedRows:C,resetSelections:E}=x,P=(0,d.useCallback)(async e=>{await b.onTabChange(e),u(),E()},[b,u,E]),{columns:N}=p({isOktaApp:!0,rowClickUrl:(0,d.useCallback)(e=>{var l;let a=null!==(l=e.id)&&void 0!==l?l:s.Kl;return"".concat(s.vi,"/").concat(h.w.INFRASTRUCTURE,"/").concat(t,"/").concat(a).concat("#".concat("all"))},[t,"all"])});return{columns:N,data:j,isLoading:g,isFetching:y,searchQuery:o,updateSearch:c,resetState:u,tableProps:x.tableProps,selectionProps:x.selectionProps,filterTabs:[{label:"All apps",hash:"all"}],activeTab:"all",handleTabChange:P,activeParams:{},selectedRows:C,hasSelectedRows:x.hasSelectedRows,resetSelections:E}},g=e=>{let{monitorId:t}=e,{columns:l,searchQuery:n,updateSearch:i,tableProps:s,selectionProps:o,filterTabs:d,activeTab:m,handleTabChange:v,selectedRows:h,hasSelectedRows:_}=f({monitorId:t});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Niu,{"aria-label":"Asset state filter",mode:"horizontal",items:d.map(e=>({key:e.hash,label:e.label})),selectedKeys:[m],onClick:async e=>{await v(e.key)},className:"mb-4","data-testid":"asset-state-filter"}),(0,a.jsxs)(r.jqI,{justify:"space-between",align:"center",className:"mb-4",children:[(0,a.jsx)(u.f,{value:n,onChange:i}),(0,a.jsx)(r.vyj,{size:"large",children:_&&(0,a.jsx)(c.a,{count:h.length})})]}),(0,a.jsx)(r.V5H,{...s,columns:l,rowSelection:o})]})};var y=()=>{let e=decodeURIComponent((0,n.useRouter)().query.monitorId);return(0,a.jsxs)(i.Z,{title:"Action center - Discovered infrastructure systems",children:[(0,a.jsx)(o.Z,{heading:"Action center",breadcrumbItems:[{title:"All activity",href:s.vi},{title:e}]}),(0,a.jsx)(g,{monitorId:e})]})}}},function(e){e.O(0,[431,7245,3931,4589,4809,2888,9774,179],function(){return e(e.s=50755)}),_N_E=e.O()}]);