import{u as useSelector,ag as selectIsFullscreenEnabled,d as userSelector,j as jsxRuntimeExports,B as Box,Z as AvailableComponents,ak as AvailablePanels,al as EPanelSize,q as mountPanel}from"./js-core.esm4.js";import{s as selectActiveResourceTab,b as selectActiveResourceSearchValues,c as selectEngines,d as selectEnginesHasMore,e as selectEnginesOffset,f as selectEnginesLoadingStatus,h as actions,S as SHARED_TEXT$2}from"./js-core.esm40.js";import{E as EResourceTypeValue}from"./js-core.esm15.js";import{t as tableInfiniteScroll}from"./js-core.esm9.js";import{E as Engines}from"./js-core.esm7.js";import{E as EmptySearch,R as ResourceCard}from"./js-core.esm105.js";import{u as useDispatch}from"./js-core.esm12.js";import"./js-core.esm30.js";import"./js-core.esm28.js";import"./js-core.esm33.js";import"./js-core.esm37.js";import"./js-core.esm46.js";var TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,EnginesTable=function(){function i(){setTimeout(function(){o(actions.engines.resetFetchedEngines()),o(actions.engines.fetchEnginesStart())},300)}var o=useDispatch(),a=useSelector(selectIsFullscreenEnabled),s=useSelector(userSelector),e=useSelector(selectActiveResourceTab),e=!!useSelector(selectActiveResourceSearchValues)[e],n=useSelector(selectEngines),t=useSelector(selectEnginesHasMore),l=useSelector(selectEnginesOffset),r=useSelector(selectEnginesLoadingStatus),c=SHARED_TEXT$2.engines.emptyState,u=SHARED_TEXT$2.engines.errorState;return jsxRuntimeExports.jsx(TableInfiniteScroll,{hasMore:t,fetchMore:function(){o(actions.engines.fetchEnginesStart())},fetchOnMount:0===n.length,TableEmptyStateComponent:e?jsxRuntimeExports.jsx(EmptySearch,{}):void 0,offset:l,items:n,itemHeight:180,isLoading:"pending"===r,error:"failure"===r,TableRowComponent:function(e){var n=e.item,t=!(Number(null==n||null==(e=n.ownerOrganization)?void 0:e.id)===Number(null==s||null==(e=s.organization)?void 0:e.organizationId));return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"".concat(180,"px")},children:jsxRuntimeExports.jsx(ResourceCard,{onClick:function(){var e={name:AvailableComponents.ENGINE_CENTER_DETAILS,config:{name:"Engine Details",engineId:n.id,isReadOnly:t,isFullScreen:a,refreshEngines:i}},s={type:AvailablePanels.APP_BAR_PANEL_TEMPLATE,marginTop:a?0:55,marginStart:a?0:80,size:EPanelSize.xlarge,parentPanelId:AvailableComponents.RESOURCE_CENTER,dimmed:0,dimmedStatus:"dimParent",borderBottom:!0};o(mountPanel({panelId:AvailableComponents.ENGINE_CENTER_DETAILS,microFrontend:e,panelConfig:s}))},height:"".concat(180,"px"),cardType:EResourceTypeValue.engine,name:null==n?void 0:n.name,description:null==n?void 0:n.description,avatarUrl:(null==n?void 0:n.signedIconPath)||(null==n?void 0:n.signedLogoPath),fallbackIcon:jsxRuntimeExports.jsx(Engines,{}),status:null==n?void 0:n.state,industries:null==n?void 0:n.industries,isCertified:null==n||null==(e=n.testingDetails)?void 0:e.isCertified,categoryClass:null==n||null==(e=n.category)||null==(e=e.type)?void 0:e.name,capability:null==n||null==(e=n.category)?void 0:e.name,package:null==n?void 0:n.resourcePackage,deploymentModel:null==n?void 0:n.deploymentModel,owner:null==n||null==(e=n.ownerOrganization)?void 0:e.name,price:null==n?void 0:n.price})})},MessageEmptyState:jsxRuntimeExports.jsx(c,{}),MessageErrorState:jsxRuntimeExports.jsx(u,{})})};export{EnginesTable as default};
