"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7620],{70293(I,n,s){s.r(n),s.d(n,{PlaylistEditPage:()=>E,default:()=>y});var t=s(74848),P=s(96540),p=s(54148),e=s(52358),v=s(98391),M=s(68763),_=s(5246),c=s(36226),D=s(69019),O=s(73277),o=s(15356),u=s(59578),l=s(37336),g=s(13718);const E=()=>{const{uid:m=""}=(0,p.g)(),{data:a,isLoading:h,isError:C,error:R}=(0,l.Uu)({name:m}),[f]=(0,l.Lv)(),{isAvailable:A,repositories:L}=(0,O.W)(u.CC.playlist),[r,d]=(0,P.useState)(),K=async i=>{if((0,o.Lo)(i)){d(i);return}f({name:i.metadata?.name??"",playlist:i}),v.Ny.push("/playlists")},T={text:(0,e.t)("playlist-edit.title","Edit playlist"),subTitle:(0,e.t)("playlist-edit.sub-title","A playlist rotates through a pre-selected list of dashboards. A playlist can be a great way to build situational awareness, or just show off your metrics to your team or visitors.")},B=i=>(0,t.jsxs)(M.B,{direction:"row",gap:1,alignItems:"center",wrap:!0,children:[(0,t.jsx)("h1",{children:i}),a&&(0,o.yF)(a)&&(0,t.jsx)(c.r,{managerKind:(0,o.CM)(a),name:(0,o.aM)(a),repositoryName:(0,o.aM)(a),sourcePath:(0,o.NQ)(a)})]});return(0,t.jsxs)(_.Y,{navId:"dashboards/playlists",pageNav:T,renderTitle:B,children:[(0,t.jsxs)(_.Y.Contents,{isLoading:h,children:[C&&(0,t.jsxs)("div",{children:[(0,t.jsx)(e.x6,{i18nKey:"playlist-edit.error-prefix",children:"Error loading playlist:"}),JSON.stringify(R)]}),a&&(0,t.jsx)(g.$,{onSubmit:K,playlist:a,showRepositorySelect:A&&(0,o.Lo)(a),repositories:L,disableRepositorySelect:!0})]}),r&&(0,t.jsx)(D.h,{resource:r,title:r.spec?.title??"",action:"update",onDismiss:()=>d(void 0)})]})},y=E}}]);

//# sourceMappingURL=PlaylistEditPage.4f900260440eb18cbf00.js.map