"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[192],{57029:(R,r,t)=>{t.r(r),t.d(r,{default:()=>A});var e=t(96540),s=t(71678),o=t(27746),n=t(44836),u=t(79938),d=t(57220),c=t(87978),h=t(39558),i=t(67061),m=t(72109),f=t(3704);const v=e.lazy(()=>t.e(617).then(t.bind(t,10153)));function g({dashboardUid:a,onDismiss:l}){return e.createElement(c._,{title:"Alert rules",subtitle:e.createElement(E,{dashboardUid:a}),onClose:l,size:"lg"},e.createElement(e.Suspense,{fallback:e.createElement(h._,{text:"Loading alert rules"})},e.createElement(v,{dashboardUid:a})))}function E({dashboardUid:a}){const l=new URLSearchParams({search:`dashboard:${a}`});return e.createElement(i.B,{gap:2},e.createElement("div",null,(0,n.t)("dashboard.alert-rules-drawer.subtitle","Alert rules related to this dashboard")),e.createElement(m.Y,{href:(0,f.c)(`/alerting/list/?${l.toString()}`)},(0,n.t)("dashboard.alert-rules-drawer.redirect-link","List in Grafana Alerting")))}function A({dashboardUid:a}){const{showModal:l,hideModal:C}=(0,e.useContext)(s.wE),{data:S=[]}=u.hK.endpoints.prometheusRuleNamespaces.useQuery({ruleSourceName:d.hY,dashboardUid:a});if(S.length===0)return null;const D=()=>{l(g,{dashboardUid:a,onDismiss:C})};return e.createElement(o.I,{tooltip:(0,n.t)("dashboard.toolbar.alert-rules","Alert rules"),icon:"bell",onClick:D,key:"button-alerting"})}}}]);

//# sourceMappingURL=alert-rules-toolbar-button.c3471911eca32a32d3c4.js.map