"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8715],{"./public/app/features/teams/CreateTeam.tsx":(e,a,t)=>{t.r(a),t.d(a,{CreateTeam:()=>u,default:()=>p});var s,n,r=t("./node_modules/react/index.js"),i=t("./public/app/core/components/Page/Page.tsx"),c=t("./packages/grafana-ui/src/index.ts"),l=t("./packages/grafana-runtime/src/index.ts"),o=t("./node_modules/react-redux/es/index.js"),d=t("./public/app/core/selectors/navModel.ts"),m=t("./node_modules/react/jsx-runtime.js");class u extends r.PureComponent{constructor(...e){var a,t,s;super(...e),s=async e=>{const a=await(0,l.getBackendSrv)().post("/api/teams",e);a.teamId&&l.locationService.push(`/org/teams/edit/${a.teamId}`)},(t="create")in(a=this)?Object.defineProperty(a,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[t]=s}render(){const{navModel:e}=this.props;return(0,m.jsx)(i.Z,{navModel:e,children:(0,m.jsx)(i.Z.Contents,{children:(0,m.jsx)(c.Form,{onSubmit:this.create,children:({register:e})=>(0,m.jsxs)(c.FieldSet,{label:"New Team",children:[(0,m.jsx)(c.Field,{label:"Name",children:(0,m.jsx)(c.Input,Object.assign({},e("name",{required:!0}),{id:"team-name",width:60}))}),(0,m.jsx)(c.Field,{label:(0,m.jsxs)(c.Label,{children:[s||(s=(0,m.jsx)("span",{children:"Email"})),(0,m.jsx)(c.Tooltip,{content:"This is optional and is primarily used for allowing custom team avatars.",children:(0,m.jsx)(c.Icon,{name:"info-circle",style:{marginLeft:6}})})]}),children:(0,m.jsx)(c.Input,Object.assign({},e("email"),{type:"email",placeholder:"email@test.com",width:60}))}),n||(n=(0,m.jsx)("div",{className:"gf-form-button-row",children:(0,m.jsx)(c.Button,{type:"submit",variant:"primary",children:"Create"})}))]})})})})}}const p=(0,o.connect)((function(e){return{navModel:(0,d.h)(e.navIndex,"teams")}}))(u)}}]);
//# sourceMappingURL=CreateTeam.8128b05ac04b15cbf98d.js.map