"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[5963],{26970:(U,i,e)=>{e.r(i),e.d(i,{RecordedQueriesConfig:()=>m,RecordedQueriesConfigUnconnected:()=>g,default:()=>Y});var t=e(74848),n=e(32196),l=e(96540),x=e(71468),u=e(40845),s=e(55852),h=e(96374),v=e(21780),Q=e(39419),j=e(17422),C=e(76442),R=e(14578);const T=()=>{const r=(0,u.of)(D);return(0,t.jsx)(C.c,{className:r.cta,message:"No recorded queries defined",footer:(0,t.jsxs)("span",{children:[(0,t.jsx)(R.I,{name:"rocket"}),"ProTip: ","You can record queries from the query editor."]},"proTipFooter"),callToActionElement:(0,t.jsx)(t.Fragment,{})})},D=r=>({cta:(0,n.css)`
      text-align: center;
    `});var P=e(80500),d=e(82063),A=e(95114);function E(r){return{navModel:(0,j.tc)(r.navIndex,"recordedQueries"),recordedQueries:(0,A.T)(r.recordedQueries),isLoading:r.recordedQueries.isLoading}}const p={getRecordedQueriesAsync:d.xY,updateRecordedQuery:d.qE,deleteRecordedQuery:d.eB},L=(0,x.connect)(E,p),g=({navModel:r,isLoading:I,recordedQueries:M,getRecordedQueriesAsync:y,updateRecordedQuery:N,deleteRecordedQuery:$})=>{(0,l.useEffect)(()=>{y()},[y]);const z=(0,u.of)(S),[c,a]=(0,l.useState)(),f=M.map(o=>{const F=[(0,t.jsx)(s.$n,{onClick:async()=>{await N({...o,active:!o.active})},variant:o.active?"secondary":"primary",children:o.active?"Pause recording":"Resume recording"},"toggle-recorded-query-active"),(0,t.jsx)(s.$n,{"aria-label":"Delete recorded query",onClick:()=>a(o),variant:"destructive",children:"Delete"},"delete-recorded-query")];return(0,t.jsx)(P.z,{recordedQuery:o,buttons:F},o.id)}),B=()=>I?(0,t.jsx)(Q.A,{}):f.length===0?(0,t.jsx)(T,{}):f;return(0,t.jsx)(v.YW,{navModel:r,children:(0,t.jsxs)(v.YW.Contents,{children:[(0,t.jsx)("div",{className:z.header,children:(0,t.jsx)(s.z9,{icon:"cog",href:"/recorded-queries/write-target",children:"Edit remote write target"})}),B(),c&&(0,t.jsx)(h.u,{isOpen:!0,icon:"trash-alt",title:"Delete",body:(0,t.jsxs)("div",{children:["Are you sure you want to delete '",c.name,"'?"]}),confirmText:"Delete",onDismiss:()=>a(void 0),onConfirm:async()=>{await $(c),a(void 0)}})]})})},S=r=>({header:(0,n.css)`
      display: flex;
      justify-content: flex-end;
      margin-bottom: ${r.spacing(1)};
    `,title:(0,n.css)`
      margin-bottom: 0;
      width: 100%;
    `}),m=L(g),Y=m}}]);

//# sourceMappingURL=RecordedQueriesConfig.093f092fec11fa65b3fb.js.map