"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4940],{71786(C,r,e){e.r(r),e.d(r,{plugin:()=>j});var g=e(16207),n=e(92745),s=e(74848),i=e(96540),f=e(75234),m=e(34999),v=e(89640),w=e(92807),x=e(46831),d=e(73745),p=e(30054);function S(t){const{width:o,options:{feedUrl:y=d.$,showImage:N}}=t,{state:a,getNews:l}=(0,p.n)(y);return(0,i.useEffect)(()=>{const h=t.eventBus.subscribe(f._,l);return()=>{h.unsubscribe()}},[l,t.eventBus]),(0,i.useEffect)(()=>{l()},[l]),a.error?(0,s.jsx)(m.F,{title:(0,n.t)("news.news-panel.title-error-loading-rss-feed","Error loading RSS feed"),children:(0,s.jsxs)(n.x6,{i18nKey:"news.news-panel.body-error-loading-rss-feed",children:["Make sure that the feed URL is correct and that CORS is configured correctly on the server. See"," ",(0,s.jsx)(v.Y,{href:"https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/news/",external:!0,children:"News panel documentation."})]})}):a.loading?(0,s.jsx)("div",{children:(0,s.jsx)(n.x6,{i18nKey:"news.news-panel.loading",children:"Loading..."})}):a.value?(0,s.jsx)(w.P,{minHeight:"100%",children:a.value.map((h,c)=>(0,s.jsx)(x.K,{index:c,width:o,showImage:N,data:a.value},c))}):null}const u={showImage:!0},j=new g.m(S).setPanelOptions(t=>{const o=[(0,n.t)("news.category-news","News")];t.addTextInput({path:"feedUrl",name:(0,n.t)("news.name-url","URL"),category:o,description:(0,n.t)("news.description-url","Supports RSS and Atom feeds"),settings:{placeholder:d.$},defaultValue:u.feedUrl}).addBooleanSwitch({path:"showImage",name:(0,n.t)("news.name-show-image","Show image"),category:o,description:(0,n.t)("news.description-show-image","Controls if the news item social (og:image) image is shown above text content"),defaultValue:u.showImage})})}}]);

//# sourceMappingURL=newsPanel.cfad8ca9d03fa6977f1c.js.map