AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

forgot-password.tsx 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Components
  2. import { Form, Head } from '@inertiajs/react';
  3. import { LoaderCircle } from 'lucide-react';
  4. import InputError from '@/components/input-error';
  5. import TextLink from '@/components/text-link';
  6. import { Button } from '@/components/ui/button';
  7. import { Input } from '@/components/ui/input';
  8. import { Label } from '@/components/ui/label';
  9. import { login } from '@/routes';
  10. import { email } from '@/routes/password';
  11. export default function ForgotPassword({ status }: { status?: string }) {
  12. return (
  13. <>
  14. <Head title="Forgot password" />
  15. {status && (
  16. <div className="mb-4 text-center text-sm font-medium text-green-600">
  17. {status}
  18. </div>
  19. )}
  20. <div className="space-y-6">
  21. <Form {...email.form()}>
  22. {({ processing, errors }) => (
  23. <>
  24. <div className="grid gap-2">
  25. <Label htmlFor="email">Email address</Label>
  26. <Input
  27. id="email"
  28. type="email"
  29. name="email"
  30. autoComplete="off"
  31. autoFocus
  32. placeholder="email@example.com"
  33. />
  34. <InputError message={errors.email} />
  35. </div>
  36. <div className="my-6 flex items-center justify-start">
  37. <Button
  38. className="w-full"
  39. disabled={processing}
  40. data-test="email-password-reset-link-button"
  41. >
  42. {processing && (
  43. <LoaderCircle className="h-4 w-4 animate-spin" />
  44. )}
  45. Email password reset link
  46. </Button>
  47. </div>
  48. </>
  49. )}
  50. </Form>
  51. <div className="space-x-1 text-center text-sm text-muted-foreground">
  52. <span>Or, return to</span>
  53. <TextLink href={login()}>log in</TextLink>
  54. </div>
  55. </div>
  56. </>
  57. );
  58. }
  59. ForgotPassword.layout = {
  60. title: 'Forgot password',
  61. description: 'Enter your email to receive a password reset link',
  62. };