import{j as s}from"./vendor-react-wBh_31cN.js";import{N as P}from"./NoData-jkjqmCYT.js";import{P as y}from"./Panel-epT8eD0X.js";import{r as o,aq as D,cg as E,g as I}from"./index-BKr2rJhV.js";import{u as w}from"./useFeatureGroupView-DA5FGFQv.js";import{u as T}from"./useFeatureGroupVersions-BYs4kN2x.js";import{u as b}from"./useUserPermissions-BVMFDLlq.js";import{c as k,u as R}from"./vendor-router-D1GqFWiT.js";const M=({children:r,pathnamePostFix:u="",route:m=o.project.featureGroup.overview,renderInPanel:p,showDelete:c,onClickDelete:f,onClickRefresh:g,editDisabledReason:i,filterToolbar:l,count:d,tools:h,isFetching:j})=>{const{id:t,fsId:n,fgId:a}=k(),{canEdit:v,isLoading:x}=b(),{data:e,isLoading:F,fetchData:C}=w(+t,+a,+n),{currentData:L=[e],isFetching:V,handleVersionChange:G}=T(e==null?void 0:e.name,m),N=R();return F?s.jsx(D,{}):s.jsxs(s.Fragment,{children:[s.jsx(y,{type:E.fg,data:e,title:e==null?void 0:e.name,id:e==null?void 0:e.id,idColor:"labels.orange",isEditDisabled:!!i||!v||x,editRightText:i,onClickEdit:()=>N(I(o.project.featureGroup.edit,o.project.value,{id:t,fsId:n,fgId:a})),onClickRefresh:g??C,showDelete:c,onClickDelete:f,version:e==null?void 0:e.version,versions:L,isVersionsLoading:V,onVersionChange:G,hasCommits:!0,pathnamePostFix:u,filterToolbar:l,count:d,tools:h,isFetching:j,children:p}),e!=null&&e.features.length?typeof r=="function"?r(e):r:s.jsx(P,{mainText:"No data available"})]})};export{M as F};
