import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Lock, KeyRound } from 'lucide-react'; interface AccessModalProps { onBetaRequest?: () => void; } export default function AccessModal({ onBetaRequest }: AccessModalProps) { const [showCodeInput, setShowCodeInput] = useState(false); const [code, setCode] = useState(''); const [error, setError] = useState(false); const [loading, setLoading] = useState(false); const [errorMessage, setErrorMessage] = useState(''); const handleUnlock = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(false); setErrorMessage(''); try { const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000'; const response = await fetch(`${apiUrl}/api/validate-code`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ code }), }); const data = await response.json(); if (response.ok && data.status === 'success') { sessionStorage.setItem('fv_access_granted', 'true'); window.location.reload(); } else { setError(true); setErrorMessage(data.detail || 'Invalid or expired code.'); } } catch (err) { setError(true); setErrorMessage('Server connection failed. Try again later.'); } finally { setLoading(false); } }; return (

Premium Access Required

You have reached the maximum limit of 3 free AI transfer evaluations. Request full enterprise access to unlock unlimited SHAP profiling, live intelligence grids, and PSR compliance modeling.

{!showCodeInput ? (
) : (
{ setCode(e.target.value); setError(false); }} style={{ borderColor: error ? 'var(--loss-color)' : '' }} autoFocus disabled={loading} /> {error && {errorMessage}}
)}
); }