"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8715],{93365:(e,a,r)=>{r.r(a),r.d(a,{CreateTeam:()=>u,default:()=>h});var t,i=r(68404),n=r(18745),s=r(90923),l=r(69783),d=r(33801),o=r(98163),c=r(8674),m=r(45916);class u extends i.PureComponent{constructor(){var e,a,r;super(...arguments),r=async e=>{const a=await(0,s.getBackendSrv)().post("/api/teams",e);a.teamId&&(await o.Vt.fetchUserPermissions(),s.locationService.push(`/org/teams/edit/${a.teamId}`))},(a="create")in(e=this)?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r}render(){const{navModel:e}=this.props;return(0,m.jsx)(d.Z,{navModel:e,children:(0,m.jsx)(d.Z.Contents,{children:(0,m.jsx)(l.Form,{onSubmit:this.create,children:e=>{let{register:a,errors:r}=e;return(0,m.jsxs)(l.FieldSet,{label:"New Team",children:[(0,m.jsx)(l.Field,{label:"Name",required:!0,invalid:!!r.name,error:"Team name is required",children:(0,m.jsx)(l.Input,Object.assign({},a("name",{required:!0}),{id:"team-name",width:60}))}),(0,m.jsx)(l.Field,{label:"Email",description:"This is optional and is primarily used for allowing custom team avatars.",children:(0,m.jsx)(l.Input,Object.assign({},a("email"),{type:"email",id:"team-email",placeholder:"email@test.com",width:60}))}),t||(t=(0,m.jsx)("div",{className:"gf-form-button-row",children:(0,m.jsx)(l.Button,{type:"submit",variant:"primary",children:"Create"})}))]})}})})})}}const h=(0,n.connect)((function(e){return{navModel:(0,c.h)(e.navIndex,"teams")}}))(u)}}]); //# sourceMappingURL=CreateTeam.73c8a6ba12c99f27c0a9.js.map