"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4940],{18918:(C,o,e)=>{e.r(o),e.d(o,{plugin:()=>j});var h=e(65158),t=e(74848),l=e(96540),f=e(3591),c=e(42418),g=e(14578),v=e(40276),m=e(69386),i=e(62372),x=e(4172);function S(n){const{width:w,options:{feedUrl:I=i.$,showImage:p}}=n,{state:a,getNews:s}=(0,x.n)(I);return(0,l.useEffect)(()=>{const u=n.eventBus.subscribe(f._,s);return()=>{u.unsubscribe()}},[s,n.eventBus]),(0,l.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.E,{autoHeightMin:"100%",autoHeightMax:"100%",children:a.value.map((u,d)=>(0,t.jsx)(m.K,{index:d,width:w,showImage:p,data:a.value},d))}):null}const r={showImage:!0},j=new h.m(S).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.7a6c4a3b292ad055d222.js.map