(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7818],{50481:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-catalog/[systemId]/projects/[projectUrn]",function(){return n(32065)}])},94780:function(e,t,n){"use strict";n.d(t,{X5:function(){return i},pN:function(){return r},sv:function(){return s}});var o=n(24246),a=n(13577);let s=e=>e.split(".")[1],c=[(0,o.jsx)(a.PJP.S9g,{},"layers"),(0,o.jsx)(a.PJP.iA_,{},"table"),(0,o.jsx)(a.PJP.$4y,{style:{transform:"rotate(-90deg)"}},"field")],i=(e,t)=>{if(!e)return[];let n=e.split(".");if(n.length<2)return[];let i=n.splice(0,2).join("."),r=[];return n.reduce((e,o,a)=>{let s=a===n.length-1,l="".concat(e).concat(".").concat(o);return r.push({title:o,href:s?void 0:"".concat(t,"/").concat(i,"/").concat(l),icon:c[a]}),l},i),[{title:s(i),href:"".concat(t,"/").concat(i),icon:(0,o.jsx)(a.PJP.ehp,{})},...r]},r=(e,t)=>{if(!e)return[];let n=e.split(".");if(n.length<2)return[];let o=n.shift(),a=[];return n.reduce((e,o,s)=>{let i=s===n.length-1,r="".concat(e).concat(".").concat(o);return a.push({title:o,href:i?void 0:"".concat(t,"/").concat(r),icon:c[s]}),r},o),a}},32065:function(e,t,n){"use strict";n.r(t);var o=n(24246),a=n(59003),s=n(92222),c=n(13577),i=n(86677),r=n(27378),l=n(77213),u=n(77830),d=n(58754),g=n(47935),f=n(98800),p=n(81406),h=n(69172),P=n(94780),j=n(70675),m=n(1315);let x={items:[],total:0,page:1,size:50,pages:1};t.default=()=>{let{query:e,push:t}=(0,i.useRouter)(),n=e.systemId,_=e.projectUrn,[w,v]=(0,r.useState)(void 0),{data:b,isLoading:C}=(0,m.rn)(n),{PAGE_SIZES:R,pageSize:N,setPageSize:k,onPreviousPageClick:y,isPreviousPageDisabled:E,onNextPageClick:z,isNextPageDisabled:X,startRange:Z,endRange:D,pageIndex:I,setTotalPages:J}=(0,g.oi)(),{isFetching:M,isLoading:S,data:T}=(0,j.z8)({staged_resource_urn:_,page:I,size:N}),{items:A,total:O,pages:U}=(0,r.useMemo)(()=>null!=T?T:x,[T]);(0,r.useEffect)(()=>{J(U)},[U,J]);let q=(0,h.Z)({onDetailClick:e=>v(e)}),F=(0,a.b7)({getCoreRowModel:(0,s.sC)(),getGroupedRowModel:(0,s.qe)(),getExpandedRowModel:(0,s.rV)(),columns:q,manualPagination:!0,data:A,columnResizeMode:"onChange"}),G=!S&&!C&&!M;return(0,o.jsxs)(l.Z,{title:"Data catalog",children:[(0,o.jsx)(d.Z,{heading:"Data catalog",breadcrumbItems:[{title:"All systems",href:u.mX},{title:(null==b?void 0:b.name)||n,href:u.mX},{title:(0,P.sv)(_),icon:(0,o.jsx)(c.PJP.ehp,{})}]}),!G&&(0,o.jsx)(g.I4,{rowHeight:36,numRows:36}),G&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.ZK,{tableInstance:F,emptyTableNotice:(0,o.jsx)(p.Z,{}),onRowClick:e=>t("".concat(u.mX,"/").concat(n,"/projects/").concat(_,"/").concat(e.urn,"/"))}),(0,o.jsx)(g.s8,{totalRows:O||0,pageSizes:R,setPageSize:k,onPreviousPageClick:y,isPreviousPageDisabled:E,onNextPageClick:z,isNextPageDisabled:X,startRange:Z,endRange:D}),(0,o.jsx)(f.Z,{dataset:w,onClose:()=>v(void 0)})]})]})}}},function(e){e.O(0,[3872,2888,9774,179],function(){return e(e.s=50481)}),_N_E=e.O()}]);