import{u as v,aR as j,j as s,a_ as x,dF as F,g as C,e as r}from"./index-d6499a22.js";import{N as L}from"./NoData-789df290.js";import{P as V}from"./Panel-b19e8cc0.js";import{u as D}from"./useFeatureGroupView-0bc6732c.js";import{u as G}from"./useFeatureGroupVersions-ae275115.js";import{u as N}from"./useUserPermissions-3851a25d.js";const R=({children:n,pathnamePostFix:t="",route:u=r.featureGroup.overview})=>{const{id:i,fsId:o,fgId:a}=v(),{canEdit:m,isLoading:g}=N(),{data:e,isLoading:p,fetchData:c}=D(+i,+a,+o),{currentData:f=[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||g,onClickEdit:()=>h(C(r.featureGroup.edit,r.project.value,{id:i,fsId:o,fgId:a})),onClickRefresh:c,version:e==null?void 0:e.version,versions:f,isVersionsLoading:l,onVersionChange:d,hasCommits:!0,pathnamePostFix:t}),e!=null&&e.features.length?n({data:e}):s.jsx(L,{mainText:"No data available"})]})};export{R as F};
