"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4940],{66751(C,l,e){e.r(l),e.d(l,{plugin:()=>j});var f=e(68256),t=e(74848),o=e(96540),h=e(86833),c=e(37e3),g=e(79784),v=e(99134),m=e(36492),i=e(60938),S=e(87518);function x(n){const{width:w,options:{feedUrl:I=i.$,showImage:p}}=n,{state:a,getNews:s}=(0,S.n)(I);return(0,o.useEffect)(()=>{const d=n.eventBus.subscribe(h._,s);return()=>{d.unsubscribe()}},[s,n.eventBus]),(0,o.useEffect)(()=>{s()},[s]),a.error?(0,t.jsxs)(c.F,{title:"Error loading RSS feed",children:["Make sure that the feed URL is correct and that CORS is configured correctly on the server. See"," ",(0,t.jsxs)("a",{style:{textDecoration:"underline"},href:"https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/news/",children:["News panel documentation. ",(0,t.jsx)(g.I,{name:"external-link-alt"})]})]}):a.loading?(0,t.jsx)("div",{children:"Loading..."}):a.value?(0,t.jsx)(v.P,{minHeight:"100%",children:a.value.map((d,u)=>(0,t.jsx)(m.K,{index:u,width:w,showImage:p,data:a.value},u))}):null}const r={showImage:!0},j=new f.m(x).setPanelOptions(n=>{n.addTextInput({path:"feedUrl",name:"URL",description:"Supports RSS and Atom feeds",settings:{placeholder:i.$},defaultValue:r.feedUrl}).addBooleanSwitch({path:"showImage",name:"Show image",description:"Controls if the news item social (og:image) image is shown above text content",defaultValue:r.showImage})})}}]);

//# sourceMappingURL=newsPanel.357ecff008f5d0719d3c.js.map