chatbot-template/components/custom/auth-form.tsx

59 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-10-23 12:33:19 -04:00
import Form from 'next/form';
import { Input } from '../ui/input';
import { Label } from '../ui/label';
2024-10-11 18:00:22 +05:30
export function AuthForm({
action,
children,
2024-10-23 12:33:19 -04:00
defaultEmail = '',
2024-10-11 18:00:22 +05:30
}: {
action: any;
children: React.ReactNode;
defaultEmail?: string;
}) {
return (
2024-10-23 12:33:19 -04:00
<Form action={action} className="flex flex-col gap-4 px-4 sm:px-16">
2024-10-11 18:00:22 +05:30
<div className="flex flex-col gap-2">
<Label
htmlFor="email"
className="text-zinc-600 font-normal dark:text-zinc-400"
>
Email Address
</Label>
<Input
id="email"
name="email"
className="bg-muted text-md md:text-sm"
type="email"
placeholder="user@acme.com"
autoComplete="email"
required
2024-11-05 11:54:57 +03:00
autoFocus
2024-10-11 18:00:22 +05:30
defaultValue={defaultEmail}
/>
</div>
2024-10-11 18:00:22 +05:30
<div className="flex flex-col gap-2">
2024-10-11 18:00:22 +05:30
<Label
htmlFor="password"
className="text-zinc-600 font-normal dark:text-zinc-400"
>
Password
</Label>
<Input
id="password"
name="password"
className="bg-muted text-md md:text-sm"
type="password"
required
/>
</div>
{children}
2024-10-23 12:33:19 -04:00
</Form>
2024-10-11 18:00:22 +05:30
);
}