All files / laravel-saas/resources/js/Pages/Auth VerifyEmail.tsx

0% Statements 0/40
100% Branches 1/1
100% Functions 1/1
0% Lines 0/40

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55                                                                                                             
import { FormEventHandler } from 'react';
import { Head, Link, useForm } from '@inertiajs/react';
import GuestLayout from '@/Components/GuestLayout';
import { Button } from '@/Components/ui/Button';
import { Alert, AlertDescription } from '@/Components/ui/Alert';
 
export default function VerifyEmail({ status }: { status?: string }) {
    const { post, processing } = useForm({});
 
    const submit: FormEventHandler = (e) => {
        e.preventDefault();
        post(route('verification.send'));
    };
 
    return (
        <GuestLayout
            header="Verify your email"
            subheader="Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you?"
        >
            <Head title="Email Verification" />
 
            <div className="space-y-4">
                {status === 'verification-link-sent' && (
                    <Alert variant="success">
                        <AlertDescription>
                            A new verification link has been sent to the email address
                            you provided during registration.
                        </AlertDescription>
                    </Alert>
                )}
 
                <p className="text-sm text-muted-foreground">
                    If you didn't receive the email, we will gladly send you another.
                </p>
 
                <form onSubmit={submit}>
                    <div className="flex items-center justify-between">
                        <Button type="submit" disabled={processing}>
                            {processing ? 'Sending...' : 'Resend Verification Email'}
                        </Button>
 
                        <Link
                            href={route('logout')}
                            method="post"
                            as="button"
                            className="text-sm text-muted-foreground hover:text-foreground underline"
                        >
                            Log Out
                        </Link>
                    </div>
                </form>
            </div>
        </GuestLayout>
    );
}