"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8715],{64143:(e,a,r)=>{r.r(a),r.d(a,{CreateTeam:()=>u,default:()=>h});var t,i=r(76687),n=r(46958),s=r(10967),l=r(70534),d=r(36131),o=r(31271),c=r(3276),m=r(52010);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.803d9ccf8151c3982f21.js.map