import { useState } from 'react'; import { api } from '../api'; import { motion, AnimatePresence } from 'framer-motion'; export const BillingModal = ({ isOpen, onClose, onKeySaved }: { isOpen: boolean, onClose: () => void, onKeySaved: () => void }) => { const [apiKey, setApiKey] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); const handleSaveKey = async () => { if (!apiKey.trim()) return; setSaving(true); setError(''); try { await api.post('/profile/api-key', { api_key: apiKey.trim() }); onKeySaved(); onClose(); } catch (err: any) { setError(err.response?.data?.detail || 'Failed to securely store API key.'); } finally { setSaving(false); } }; if (!isOpen) return null; return (
⚠️

Build Limit Reached

You've used your 2 free autonomous chip builds! To continue generating RTL and running Silicon validations, you must provide your own LLM API key or upgrade your plan.

Bring Your Own Key (BYOK)

Enter an OpenAI, Anthropic, or Groq API key. Your key is AES-256 encrypted at rest using a secure server-side key and is never logged or exposed.

setApiKey(e.target.value)} autoFocus /> {error &&
{error}
}
or contact sales for an Enterprise/Pro Plan.
); };