"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2508],{49562:(C,E,a)=>{a.r(E),a.d(E,{default:()=>O});var e=a(68404),m=a(70356),d=a(54899),_=a(94270),r=a(24799),s=a(46967),o=a(31403),i=a(79396);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.53525f0888ced8d7adda.js.map