Sha256: 7f73ef674b08a09a72d5a140ee9272ae4b8052f81f78a511ec878f7680ef0cc8

Contents?: true

Size: 1.79 KB

Versions: 5

Compression:

Stored size: 1.79 KB

Contents

import GuestLayout from '@/Layouts/GuestLayout';
import InputError from '@/Components/InputError';
import PrimaryButton from '@/Components/PrimaryButton';
import TextInput from '@/Components/TextInput';
import { Head, useForm } from '@inertiajs/react';
import { FormEventHandler } from 'react';
import { password_email_path } from '@/routes';

export default function ForgotPassword({ status }: { status?: string }) {
    const { data, setData, post, processing, errors } = useForm({
        email: '',
    });

    const submit: FormEventHandler = (e) => {
        e.preventDefault();

        post(password_email_path());
    };

    return (
        <GuestLayout>
            <Head title="Forgot Password" />

            <div className="mb-4 text-sm text-gray-600">
                Forgot your password? No problem. Just let us know your email address and we will email you a password
                reset link that will allow you to choose a new one.
            </div>

            {status && <div className="mb-4 font-medium text-sm text-green-600">{status}</div>}

            <form onSubmit={submit}>
                <TextInput
                    id="email"
                    type="email"
                    name="email"
                    value={data.email}
                    className="mt-1 block w-full"
                    isFocused={true}
                    onChange={(e) => setData('email', e.target.value)}
                />

                <InputError message={errors.email} className="mt-2" />

                <div className="flex items-center justify-end mt-4">
                    <PrimaryButton className="ms-4" disabled={processing}>
                        Email Password Reset Link
                    </PrimaryButton>
                </div>
            </form>
        </GuestLayout>
    );
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kaze-0.5.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.4.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.3.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.2.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.1.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx