"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8932],{41669:(I,r,a)=>{a.r(r),a.d(r,{default:()=>C});var e=a(39953),_=a(89772),s=a(32688),E=a(85830),m=a(96227),P=a(38637),c=a(12223),o=a(4919),l=a(13253),f=a(67650),D=a(17712),u=a(83600);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.328c23cb411ee34790d2.js.map