"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2560],{27799:(x,i,t)=>{t.r(i),t.d(i,{ReportPage:()=>m,default:()=>S});var n=t(74848),d=t(96540),g=t(71468),p=t(54148),v=t(2e3),P=t(60928),j=t(61692),E=t(16329),h=t(72489),C=t(32370),f=t(54122),L=t(20337),N=t(17203);const I=({report:a,editMode:e})=>{const{name:o,dashboardName:s=""}=a;return{text:!a.id&&!e?"New report":o||s}},T=({children:a,editMode:e,isLoading:o,className:s,report:c,...r})=>{(0,d.useEffect)(()=>{document.title=`Reporting: ${e?"Edit report":"New report"}`},[e]);const l=I({report:c,editMode:e});return(0,n.jsx)(f.Y,{navId:"reports-list",pageNav:l,children:(0,n.jsx)(f.Y.Contents,{children:(0,n.jsx)("div",{...r,children:o?(0,n.jsx)(L.A,{}):C.$.rendererAvailable?a:(0,n.jsx)(N.c,{variant:"error"})})})})},D=(a,e)=>{const{report:o,isLoading:s}=a.reports;return{existingReport:!!o.id,isLoading:s,report:o}},A={loadReport:E.N1,clearReportState:h.$J},O=(0,g.connect)(D,A),m=({existingReport:a,isLoading:e,loadReport:o,report:s,clearReportState:c})=>{const{id:r,step:l=P.StepKey.SelectDashboard}=(0,p.g)(),R=!!(r&&e);(0,d.useEffect)(()=>(r&&o(parseInt(r,10)),()=>{c()}),[r,o,c]);const B=(0,d.useCallback)(()=>{const u=j.E.find(({id:M})=>M===l)?.component;return u?(0,n.jsx)(u,{reportId:r}):null},[l,r]);return(0,n.jsx)(T,{isLoading:R,editMode:a,report:s,children:R?(0,n.jsx)(v.a,{}):B()})},S=O(m)},2e3:(x,i,t)=>{t.d(i,{a:()=>p});var n=t(74848),d=t(90231),g=t(81876);const p=({text:v="Loading..."})=>(0,n.jsx)(d.a,{display:"flex",alignItems:"center",direction:"column",justifyContent:"center",paddingTop:10,children:(0,n.jsx)(g._,{text:v})})}}]);

//# sourceMappingURL=ReportPage.222d30b8874ebffe2b30.js.map