123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import { Form, Head } from '@inertiajs/react';
- import { LoaderCircle } from 'lucide-react';
- import PasswordResetLinkController from '@/actions/App/Http/Controllers/Auth/PasswordResetLinkController';
- import { InputError } from '@/common/InputError';
- import { TextLink } from '@/common/TextLink';
- import AuthLayout from '@/pages/layouts/AuthLayout';
- import { login } from '@/routes';
- import { Button } from '@/shadcn/button';
- import { Input } from '@/shadcn/input';
- import { Label } from '@/shadcn/label';
- export default function ForgotPasswordPage({ status }: { status?: string }) {
- return (
- <AuthLayout title="Forgot password" description="Enter your email to receive a password reset link">
- <Head title="Forgot password" />
- {status && <div className="mb-4 text-center text-sm font-medium text-green-600">{status}</div>}
- <div className="space-y-6">
- <Form {...PasswordResetLinkController.store.form()}>
- {({ processing, errors }) => (
- <>
- <div className="grid gap-2">
- <Label htmlFor="email">Email address</Label>
- <Input id="email" type="email" name="email" autoComplete="off" autoFocus placeholder="email@example.com" />
- <InputError message={errors.email} />
- </div>
- <div className="my-6 flex items-center justify-start">
- <Button className="w-full" disabled={processing}>
- {processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
- Email password reset link
- </Button>
- </div>
- </>
- )}
- </Form>
- <div className="space-x-1 text-center text-sm text-muted-foreground">
- <span>Or, return to</span>
- <TextLink href={login()}>log in</TextLink>
- </div>
- </div>
- </AuthLayout>
- );
- }
|