'use client' import { useState, useEffect, Suspense } from 'react' import { useRouter, useSearchParams } from 'next/navigation' import Link from 'next/link' import Image from 'next/image' import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { Loader2, ArrowRight, Check, Eye, EyeOff, Mail, Shield, Zap, TrendingUp } from 'lucide-react' import clsx from 'clsx' // Logo Component function Logo() { return ( ) } // OAuth Icons function GoogleIcon({ className }: { className?: string }) { return ( ) } function GitHubIcon({ className }: { className?: string }) { return ( ) } const benefits = [ { text: 'Live Market Feed', icon: Zap }, { text: 'Daily Scan Reports', icon: Shield }, { text: 'Yield Intel Access', icon: TrendingUp }, ] function RegisterForm() { const router = useRouter() const searchParams = useSearchParams() const { register } = useStore() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [showPassword, setShowPassword] = useState(false) const [error, setError] = useState(null) const [loading, setLoading] = useState(false) const [oauthProviders, setOauthProviders] = useState({ google_enabled: false, github_enabled: false }) const [registered, setRegistered] = useState(false) // Get redirect URL from query params const redirectTo = searchParams.get('redirect') || '/terminal/radar' // Load OAuth providers useEffect(() => { api.getOAuthProviders().then(setOauthProviders).catch(() => {}) }, []) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError(null) setLoading(true) try { await register(email, password) if (redirectTo !== '/terminal/radar') { localStorage.setItem('pounce_redirect_after_login', redirectTo) } setRegistered(true) } catch (err) { setError(err instanceof Error ? err.message : 'Registration failed') } finally { setLoading(false) } } // Generate login link with redirect preserved const loginLink = redirectTo !== '/terminal/radar' ? `/login?redirect=${encodeURIComponent(redirectTo)}` : '/login' // Show verification message after registration if (registered) { return ( {/* Background Atmosphere */} {/* Tech Corners */} Verify Credentials Security protocol initiated. Verification link sent to {email} Proceed to Login Resend Link ) } return ( {/* Living Background Atmosphere */} {/* Animated Orbs */} {/* Grid Overlay */} {/* Left Panel - Form */} {/* Card Container */} {/* Tech Corners */} {/* Logo */} {/* Header */} New Operator Initialize Access. Create your secure terminal account. {/* Form */} {error && ( {error} )} Email Address setEmail(e.target.value)} placeholder="OPERATOR@POUNCE.IO" required autoComplete="email" className="w-full bg-[#0A0A0A] border border-white/10 px-4 py-3 text-white font-mono text-sm placeholder:text-white/20 focus:outline-none focus:border-accent transition-all rounded-none" /> Create Passcode setPassword(e.target.value)} placeholder="MIN 8 CHARS" required minLength={8} autoComplete="new-password" className="w-full bg-[#0A0A0A] border border-white/10 px-4 py-3 text-white font-mono text-sm placeholder:text-white/20 focus:outline-none focus:border-accent transition-all rounded-none pr-12" /> setShowPassword(!showPassword)} className="absolute right-4 top-1/2 -translate-y-1/2 text-white/30 hover:text-white transition-colors" aria-label={showPassword ? 'Hide password' : 'Show password'} > {showPassword ? ( ) : ( )} {loading ? ( ) : ( <> Enter Terminal > )} {/* OAuth Buttons */} {(oauthProviders.google_enabled || oauthProviders.github_enabled) && ( Alternative Access {oauthProviders.google_enabled && ( Google )} {oauthProviders.github_enabled && ( GitHub )} )} {/* Login Link */} Already authorized?{' '} Sign In {/* Right Panel - Benefits */} Scout Access: Granted Your command center is waiting. {benefits.map((item) => ( {item.text} ))} // ENCRYPTED CONNECTION // NO CREDIT CARD REQUIRED ) } export default function RegisterPage() { return ( }> ) }
Security protocol initiated. Verification link sent to {email}
Create your secure terminal account.
{error}
Already authorized?{' '} Sign In
// ENCRYPTED CONNECTION // NO CREDIT CARD REQUIRED