Can anyone help me with printing the email a user enters into the textfield within the Dialog when a button is clicked? I have been struggling to achieve this due to my function's structure. Any guidance would be greatly appreciated.
export default function ConsultantsHeader (props) {
return (
<div>
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
<DialogTitle id="dialog-title">Invite Consultant</DialogTitle>
<DialogContent>
<DialogContentText>
To invite a new X, please enter their email below:
</DialogContentText>
<TextField
autoFocus
margin="dense"
id="email"
label="Email Address"
type="email"
fullWidth
color="secondary"
variant="outlined"
/>
</DialogContent>
<DialogActions>
<Button
color="inherit"
size="small"
onClick={handleClose} >
Cancel
</Button>
<Button
onClick={inviteConsultant}
variant="contained"
color="secondary"
size="small">
Send Invite
</Button>
</DialogActions>
</Dialog>
</div>
);
}