import{u as v,aS as j,j as s,a$ as x,dJ as F,c as C,b as r}from"./index-ea7817a2.js";import{N as L}from"./NoData-8733f606.js";import{P as V}from"./Panel-041c5d61.js";import{u as D}from"./useFeatureGroupView-80b143cb.js";import{u as G}from"./useFeatureGroupVersions-ee161b97.js";import{u as N}from"./useUserPermissions-d2903885.js";const k=({children:n,pathnamePostFix:t="",route:u=r.featureGroup.overview})=>{const{id:i,fsId:o,fgId:a}=v(),{canEdit:m,isLoading:c}=N(),{data:e,isLoading:p,fetchData:f}=D(+i,+a,+o),{currentData:g=[e],isFetching:l,handleVersionChange:d}=G(e==null?void 0:e.name,u),h=j();return p?s.jsx(x,{}):s.jsxs(s.Fragment,{children:[s.jsx(V,{type:F.fg,data:e,title:e==null?void 0:e.name,id:e==null?void 0:e.id,idColor:"labels.orange",isEditDisabled:!m||c,onClickEdit:()=>h(C(r.featureGroup.edit,r.project.value,{id:i,fsId:o,fgId:a})),onClickRefresh:f,version:e==null?void 0:e.version,versions:g,isVersionsLoading:l,onVersionChange:d,hasCommits:!0,pathnamePostFix:t}),e!=null&&e.features.length?n({data:e}):s.jsx(L,{mainText:"No data available"})]})};export{k as F};
