import{r as g,aY as f,u as P,gy as j,aS as E,j as t,a$ as F,cf as b,c as I,b as l,E as v,aZ as D}from"./index-ea7817a2.js";import{G}from"./GrafanaDashboard-28e0dd4b.js";import{P as M}from"./Panel-041c5d61.js";import{N as T}from"./NoData-8733f606.js";import{u as k}from"./useUserPermissions-d2903885.js";import"./Deprecated-9bfe2e44.js";import"./CardActionButton-6aa39bc1.js";import"./index-8f672200.js";import"./file-utils-a5f053e8.js";import"./useCurrentProject-0132f110.js";import"./useProject-77619fff.js";const y=()=>{f(D.fgMetrics);const{id:o,fsId:i,fgId:n}=P(),{currentData:e,isFetching:m,refetch:p}=j({pId:+o,fsId:+i,fgId:+n}),a=[{name:"topic",value:e==null?void 0:e.onlineTopicName}],c=E(),{canEdit:u,isLoading:d,isDataScientist:h}=k(),s="grafana/d-solo/onlineFS/onlinefs",r="350px",x=[{title:"Processing Time",height:r,linkParams:{urlPath:s,variables:a,panelId:10}},{title:"Messages/Topic rate",height:r,linkParams:{urlPath:s,variables:a,panelId:7}},{title:"Byte rate",height:r,linkParams:{urlPath:s,variables:a,panelId:18}}];return m?t.jsx(F,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(M,{title:e==null?void 0:e.name,version:e==null?void 0:e.version,data:e,idColor:(e==null?void 0:e.type)==="onDemandFeaturegroupDTO"?"labels.blue":"labels.orange",isEditDisabled:!u||h||d,onClickEdit:()=>{c(I(l.featureGroup.edit,l.project.value,{id:o,fsId:i,fgId:n}))},onClickRefresh:p,pathnamePostFix:"/metrics"}),t.jsxs(v,{mt:"60px",title:"Metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(T,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(G,{panels:x})]})]}):t.jsx(b,{})},Y=g.memo(y);export{Y as default};
