import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { useAuth } from '../../hooks/useAuth.tsx'; const CTASection = () => { const { isAuthenticated } = useAuth(); const [showContact, setShowContact] = useState(false); const [sent, setSent] = useState(false); const [form, setForm] = useState({ name: '', email: '', phone: '', message: '' }); // Close on Esc useEffect(() => { if (!showContact) return; const h = (e: KeyboardEvent) => { if (e.key === 'Escape') setShowContact(false); }; window.addEventListener('keydown', h); return () => window.removeEventListener('keydown', h); }, [showContact]); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // In production this would POST to a backend endpoint setSent(true); setTimeout(() => { setSent(false); setShowContact(false); setForm({ name: '', email: '', phone: '', message: '' }); }, 3000); }; const inputStyle: React.CSSProperties = { width: '100%', padding: '0.75rem 1rem', borderRadius: '0.5rem', border: '1px solid var(--panel-border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', fontSize: '0.875rem', outline: 'none', transition: 'border-color 0.2s', }; return ( <> {/* Contact Sales Modal */} {showContact && (
setShowContact(false)} >
e.stopPropagation()} > {/* accent */}
{sent ? (

Message sent

We'll get back to you within 24 hours.

) : ( <> {/* header */}

Contact Sales

Get in touch for enterprise pricing, custom deployments, or API access.

setForm(p => ({ ...p, name: e.target.value }))} placeholder="Akash Virdi" style={inputStyle} onFocus={e => e.target.style.borderColor = '#00E5CC'} onBlur={e => e.target.style.borderColor = 'var(--panel-border)'} />
setForm(p => ({ ...p, phone: e.target.value }))} placeholder="+91-7973066831" style={inputStyle} onFocus={e => e.target.style.borderColor = '#00E5CC'} onBlur={e => e.target.style.borderColor = 'var(--panel-border)'} />
setForm(p => ({ ...p, email: e.target.value }))} placeholder="virdiakash77@gmail.com" style={inputStyle} onFocus={e => e.target.style.borderColor = '#00E5CC'} onBlur={e => e.target.style.borderColor = 'var(--panel-border)'} />