import{r as g,aX as f,u as P,gr as j,aR as F,j as t,a_ as I,ce as b,g as E,e as l,K as v,aY as D}from"./index-d6499a22.js";import{G}from"./GrafanaDashboard-d51b4440.js";import{P as M}from"./Panel-b19e8cc0.js";import{N as T}from"./NoData-789df290.js";import{u as k}from"./useUserPermissions-3851a25d.js";import"./Deprecated-ec8916ed.js";import"./CardActionButton-ccf1bc35.js";import"./index-da50fbe6.js";import"./file-utils-b5704e1c.js";import"./useCurrentProject-b23444be.js";import"./useProject-0d0fdeb3.js";const N=()=>{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=F(),{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(I,{}):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(E(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,{})},X=g.memo(N);export{X as default};
