"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2508],{41232:(C,E,a)=>{a.r(E),a.d(E,{default:()=>O});var e=a(39953),m=a(53721),d=a(4148),_=a(85830),r=a(96227),s=a(38637),o=a(4919),i=a(13253);const c=async l=>(0,d.i)().post("/api/admin/users",l),P={icon:"user",id:"user-new",text:"New user",subTitle:"Create a new Grafana user."},O=()=>{const l=(0,m.k6)(),g=(0,e.useCallback)(async t=>{const{id:n}=await c(t);l.push(`/admin/users/edit/${n}`)},[l]);return e.createElement(i.T,{navId:"global-users",pageNav:P},e.createElement(i.T.Contents,null,e.createElement(_.l,{onSubmit:g,validateOn:"onBlur"},({register:t,errors:n})=>e.createElement(e.Fragment,null,e.createElement(r.g,{label:"Name",required:!0,invalid:!!n.name,error:n.name?"Name is required":void 0},e.createElement(s.I,{id:"name-input",...t("name",{required:!0})})),e.createElement(r.g,{label:"Email"},e.createElement(s.I,{id:"email-input",...t("email")})),e.createElement(r.g,{label:"Username"},e.createElement(s.I,{id:"username-input",...t("login")})),e.createElement(r.g,{label:"Password",required:!0,invalid:!!n.password,error:n.password?"Password is required and must contain at least 4 characters":void 0},e.createElement(s.I,{id:"password-input",...t("password",{validate:u=>u.trim()!==""&&u.length>=4}),type:"password"})),e.createElement(o.zx,{type:"submit"},"Create user")))))}}}]);

//# sourceMappingURL=UserCreatePage.d12378ec2fe3c8e3e248.js.map