"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8932],{65955:(I,r,a)=>{a.r(r),a.d(r,{default:()=>C});var e=a(27702),_=a(27173),s=a(34667),E=a(23839),m=a(22209),P=a(1128),c=a(64022),o=a(66670),l=a(44644),f=a(89033),D=a(39345),u=a(35381);const i={createNewFolder:u.W7},M=(0,_.connect)(null,i),O={folderName:""},v={text:"Create a new folder",subTitle:"Folders provide a way to group dashboards and alert rules."};function g({createNewFolder:T}){const[d]=(0,f.K)(),U=n=>{const t=typeof d.folderUid=="string"?d.folderUid:void 0;T(n.folderName,t)},h=n=>D.t.validateNewFolderName(n).then(()=>!0).catch(t=>t.message);return e.createElement(l.T,{navId:"dashboards/browse",pageNav:v},e.createElement(l.T.Contents,null,e.createElement(E.l,{defaultValues:O,onSubmit:U},({register:n,errors:t})=>e.createElement(e.Fragment,null,e.createElement(m.g,{label:"Folder name",invalid:!!t.folderName,error:t.folderName&&t.folderName.message},e.createElement(P.I,{id:"folder-name-input",...n("folderName",{required:"Folder name is required.",validate:async A=>await h(A)})})),e.createElement(c.Lh,null,e.createElement(o.zx,{type:"submit"},"Create"),e.createElement(o.Qj,{variant:"secondary",href:`${s.config.appSubUrl}/dashboards`},"Cancel"))))))}const C=M(g)}}]);

//# sourceMappingURL=NewDashboardsFolder.a4a477ed6ecbfa897206.js.map