"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[192],{48278(R,e,t){t.r(e),t.d(e,{default:()=>A});var l=t(74848),n=t(96540),a=t(92745),o=t(8515),d=t(7895),u=t(70327),i=t(52161),h=t(8207),c=t(6975),g=t(41654),x=t(89640),v=t(92367);const f=(0,n.lazy)(()=>t.e(617).then(t.bind(t,25080)));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.8eb1e751440211e437e5.js.map