"use client"; import { useState } from "react"; import Image from "next/image"; import { Film, Lock, Eye, EyeOff } from "lucide-react"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { Montserrat } from "next/font/google"; const montserrat = Montserrat({ subsets: ["latin"], weight: ["200", "500", "600"], }); interface ReviewPasswordGateProps { token: string; onUnlocked: () => void; } export function ReviewPasswordGate({ token, onUnlocked }: ReviewPasswordGateProps) { const [password, setPassword] = useState(""); const [showPassword, setShowPassword] = useState(false); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!password.trim()) return; setLoading(true); setError(null); try { const res = await fetch(`/api/client/${token}/auth`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ password }), }); if (res.ok) { onUnlocked(); } else { const data = await res.json().catch(() => ({})); setError(data.error ?? "Incorrect password. Please try again."); } } catch { setError("Something went wrong. Please try again."); } finally { setLoading(false); } }; return (
{/* Logo */}
Logo
TWO TALES vfx review
{/* Card */}

Password Required

This review link is password protected. Enter the password to access the content.

setPassword(e.target.value)} className="pr-10 bg-zinc-950 border-zinc-700 focus:border-amber-500/50" autoFocus disabled={loading} />
{error && (

{error}

)}

Contact your studio if you don't have the password.

); }