"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2508],{37457:(C,E,a)=>{a.r(E),a.d(E,{default:()=>O});var e=a(65237),m=a(60894),d=a(55041),_=a(46181),r=a(5263),s=a(96682),o=a(48389),i=a(38992);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.",breadcrumbs:[{title:"Server admin",url:"admin/users"}]},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.d5c0cd6ddf48eb175d76.js.map