import{j as s}from"./vendor-react-wBh_31cN.js";import{N as P}from"./NoData-BtM2pAIA.js";import{P as y}from"./Panel-D_anPZvo.js";import{r as o,aq as D,cg as E,g as I}from"./index-dNe6i2rS.js";import{u as w}from"./useFeatureGroupView-DzipL71b.js";import{u as T}from"./useFeatureGroupVersions-NTqLwoPU.js";import{u as b}from"./useUserPermissions-Bu9Wyk8A.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};
