import { Col, Widget, WidgetHeader } from "../ui/index"; import axios, { AxiosResponse } from "axios"; import * as React from "react"; import { API } from "../api/index"; import { UnsafeError } from "../interfaces"; import { ResendPanelBody } from "./resend_panel_body"; import { t } from "../i18next_wrapper"; interface Props { email: string; /** Callback when resend succeeds */ ok(resp: AxiosResponse): void; /** Callback when resend fails */ no(error: UnsafeError): void; onGoBack(): void; } interface State { } export class ResendVerification extends React.Component { state: State = {}; render() { return resendEmail(this.props.email) .then(this.props.ok, this.props.no)} /> ; } } export function resendEmail(email: string) { return axios.post(API.current.userResendConfirmationPath, { email }); }