1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3130],{16996:function(e,l,n){n.d(l,{n:function(){return s}});var r=n(52322);n(2784);var a=n(92679),o=n(85801),t=n(65992);let i=(0,t.ZP)(o.Z)(e=>{let{theme:l}=e;return{position:"absolute",right:8,top:8,color:l.palette.grey[500],[l.breakpoints.down("sm")]:{right:"2px",top:"2px"}}});function s(e){return(0,r.jsx)(i,{"aria-label":"Close",title:"Close",onClick:e.onClick,children:(0,r.jsx)(a.Z,{htmlColor:e.color})})}},23130:function(e,l,n){n.r(l),n.d(l,{default:function(){return C}});var r=n(52322),a=n(74448),o=n(16996),t=n(35936),i=n(6060),s=n(45596),c=n(5971),d=n(69089),u=n(37303),h=n(2784),p=n(22829),m=n(24511);function x(e){let{handleApiError:l}=(0,p._)(),[n,d]=(0,h.useState)(!1),[x,C]=(0,h.useState)(""),[f,j]=(0,h.useState)(!1),k=async()=>{try{m.Z_().email().required().validateSync(x),j(!1)}catch(e){j(!0);return}if(!n){d(!0);try{await u.E.addTeacherToSchool(e.schoolId,x),e.onSuccess()}catch(e){d(!1),l(e)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.Z,{children:["Add Teacher",(0,r.jsx)(o.n,{onClick:e.onClose})]}),(0,r.jsx)(i.Z,{children:(0,r.jsx)(s.Z,{type:"email",label:"Email address",placeholder:"Email address",required:!0,size:"small",fullWidth:!0,autoFocus:!0,margin:"normal",error:f,helperText:f?"Invalid email address":"",value:x,onChange:e=>C(e.target.value)})}),(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(a.u,{size:"small",color:"error",variant:"outlined",onClick:e.onClose,children:"Cancel"}),(0,r.jsx)(a.u,{size:"small",color:"primary",variant:"contained",disableElevation:!0,onClick:k,loading:n,children:"Add Teacher"})]})]})}function C(e){return(0,r.jsx)(d.Z,{open:e.open,onClose:e.onClose,fullWidth:!0,maxWidth:"sm",keepMounted:!1,children:(0,r.jsx)(x,{...e})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.