"use client"; import { Eye, EyeOff, Lock, Mail, User } from "lucide-react"; import Link from "next/link"; import { useTranslations } from "next-intl"; import { useActionState, useState } from "react"; import { register } from "@/actions/register"; interface RegisterFormProps { hotelName: string; captcha: { provider: string; siteKey?: string }; error?: string; } export function RegisterForm({ hotelName, captcha, error }: RegisterFormProps) { const t = useTranslations("pages.register"); const showCaptcha = captcha.provider !== "none" && !!captcha.siteKey; const [serverError, formAction, isPending] = useActionState(register, null); const [termsAccepted, setTermsAccepted] = useState(false); const [showPassword, setShowPassword] = useState(false); return (
{/* Header */}

{t("title")}

{t("subtitle", { hotel: hotelName })}

{(error || serverError) && (

{error || serverError}

)}
{/* Terms */}
{/* Captcha */} {showCaptcha && captcha.provider === "turnstile" && (
)} {showCaptcha && captcha.provider === "recaptcha" && (
)}

{t("alreadyHaveAccount")}{" "} {t("signIn")}

); }