- Updated import paths for various components to align with new directory structure. - Changed imports from 'row-actions', 'confirm-dialog', 'image-preview-button', and 'file-upload' to their respective new locations in 'data-display', 'dialogs', and 'inputs'. - Adjusted imports in multiple pages including purchase, restock, transaction, category, customer, product, raw-material, supplier, roles, and settings. - Ensured all relevant components are imported from their new locations to maintain functionality.
76 lines
2.8 KiB
TypeScript
76 lines
2.8 KiB
TypeScript
// Components
|
|
import { Form, Head } from '@inertiajs/react';
|
|
import { LoaderCircle } from 'lucide-react';
|
|
import { toast } from 'sonner';
|
|
import { InputError } from '@/components/ui';
|
|
import { TextLink } from '@/components/ui';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
import { login } from '@/routes';
|
|
import { email } from '@/routes/password';
|
|
|
|
export default function ForgotPassword({ status }: { status?: string }) {
|
|
return (
|
|
<>
|
|
<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
|
|
{...email.form()}
|
|
onError={() => {
|
|
toast.error('Terjadi kesalahan saat menyimpan data. Silakan periksa kembali input Anda.');
|
|
}}
|
|
>
|
|
{({ 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}
|
|
data-test="email-password-reset-link-button"
|
|
>
|
|
{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>
|
|
</>
|
|
);
|
|
}
|
|
|
|
ForgotPassword.layout = {
|
|
title: 'Forgot password',
|
|
description: 'Enter your email to receive a password reset link',
|
|
};
|