"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[192],{1915(R,e,t){t.r(e),t.d(e,{default:()=>A});var l=t(14553),n=t(55501),a=t(52358),o=t(48624),d=t(19724),u=t(63244),i=t(82586),h=t(68004),c=t(13400),g=t(68763),x=t(45415),v=t(30390);const f=(0,n.lazy)(()=>t.e(617).then(t.bind(t,17863)));function j({dashboardUid:r,onDismiss:s}){return(0,l.jsx)(h._,{title:(0,a.t)("alerting.alert-rules-drawer.title-alert-rules","Alert rules"),subtitle:(0,l.jsx)(m,{dashboardUid:r}),onClose:s,size:"lg",children:(0,l.jsx)(n.Suspense,{fallback:(0,l.jsx)(c._,{text:(0,a.t)("alerting.alert-rules-drawer.text-loading-alert-rules","Loading alert rules")}),children:(0,l.jsx)(f,{dashboardUid:r})})})}function m({dashboardUid:r}){const s=new URLSearchParams({search:`dashboard:${r}`});return(0,l.jsxs)(g.B,{gap:2,children:[(0,l.jsx)("div",{children:(0,a.t)("dashboard.alert-rules-drawer.subtitle","Alert rules related to this dashboard")}),(0,l.jsx)(x.Y,{href:(0,v.G3)(`/alerting/list/?${s.toString()}`),children:(0,a.t)("dashboard.alert-rules-drawer.redirect-link","List in Grafana Alerting")})]})}function A({dashboardUid:r}){const{showModal:s,hideModal:C}=(0,n.useContext)(o.wE),{data:S=[]}=u.hK.endpoints.prometheusRuleNamespaces.useQuery({ruleSourceName:i.hY,dashboardUid:r});if(S.length===0)return null;const D=()=>{s(j,{dashboardUid:r,onDismiss:C})};return(0,l.jsx)(d.I,{tooltip:(0,a.t)("dashboard.toolbar.alert-rules","Alert rules"),icon:"bell",onClick:D},"button-alerting")}}}]);

//# sourceMappingURL=alert-rules-toolbar-button-react19.5b510c7a049928d49fac.js.map