Sha256: 979df99c7b1eeec1815f9721b9d2e7aa12d677fe73f237e2cf317292a74f3677

Contents?: true

Size: 1.58 KB

Versions: 3

Compression:

Stored size: 1.58 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

3 entries across 3 versions & 1 rubygems

Version Path
kaze-0.8.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.7.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.6.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx