Sha256: e2de9de3a04e9623e46fda6f83687575ec125920d1184e039d2fa7346b21d5ba

Contents?: true

Size: 1.59 KB

Versions: 12

Compression:

Stored size: 1.59 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 dark:text-gray-400">
        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 dark:text-green-400">{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

12 entries across 12 versions & 1 rubygems

Version Path
kaze-1.0.1 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-1.0.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.19.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.18.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.17.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.16.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.15.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.14.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.13.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.12.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.11.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx
kaze-0.10.0 stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx