"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2508],{13658:(C,E,a)=>{a.r(E),a.d(E,{default:()=>O});var e=a(27702),m=a(7662),d=a(73289),_=a(23839),r=a(22209),s=a(1128),o=a(66670),i=a(44644);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.7e3cfc8f8fe8239893c0.js.map