import React, { FC, useState } from 'react'; import { Form, Field, Input, Button, Legend, Container, HorizontalGroup, LinkButton } from '@grafana/ui'; import { getConfig } from 'app/core/config'; import { getBackendSrv } from '@grafana/runtime'; import appEvents from 'app/core/app_events'; import { AppEvents } from '@grafana/data'; interface EmailDTO { email: string; } export const VerifyEmail: FC = () => { const [emailSent, setEmailSent] = useState(false); const onSubmit = (formModel: EmailDTO) => { getBackendSrv() .post('/api/user/signup', formModel) .then(() => { setEmailSent(true); }) .catch((err) => { const msg = err.data?.message || err; appEvents.emit(AppEvents.alertWarning, [msg]); }); }; if (emailSent) { return (

An email with a verification link has been sent to the email address. You should receive it shortly.

Complete Signup
); } return (
{({ register, errors }) => ( <> Verify Email Back to login )}
); };