'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { motion, useReducedMotion } from 'framer-motion'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Toggle from '@/components/ui/Toggle'; import SectionHeader from '@/components/ui/SectionHeader'; import FormField from '@/components/ui/FormField'; import PageHeader from '@/components/ui/PageHeader'; import { Settings, Building2, Mail, Globe, Upload, Save, Bell, Shield, Eye, Trash2, CheckCircle, User, Phone, MapPin, FileText, Link as LinkIcon, Image as ImageIcon, Lock, Key, Smartphone, AlertCircle } from 'lucide-react'; // ============================================================================ // Types // ============================================================================ interface SponsorProfile { companyName: string; contactName: string; contactEmail: string; contactPhone: string; website: string; description: string; logoUrl: string | null; industry: string; address: { street: string; city: string; country: string; postalCode: string; }; taxId: string; socialLinks: { twitter: string; linkedin: string; instagram: string; }; } interface NotificationSettings { emailNewSponsorships: boolean; emailWeeklyReport: boolean; emailRaceAlerts: boolean; emailPaymentAlerts: boolean; emailNewOpportunities: boolean; emailContractExpiry: boolean; } interface PrivacySettings { publicProfile: boolean; showStats: boolean; showActiveSponsorships: boolean; allowDirectContact: boolean; } // ============================================================================ // Mock Data // ============================================================================ const MOCK_PROFILE: SponsorProfile = { companyName: 'Acme Racing Co.', contactName: 'John Smith', contactEmail: 'sponsor@acme-racing.com', contactPhone: '+1 (555) 123-4567', website: 'https://acme-racing.com', description: 'Premium sim racing equipment and accessories for competitive drivers. We specialize in high-performance steering wheels, pedals, and cockpit systems used by professionals worldwide.', logoUrl: null, industry: 'Racing Equipment', address: { street: '123 Racing Boulevard', city: 'Indianapolis', country: 'United States', postalCode: '46222', }, taxId: 'US12-3456789', socialLinks: { twitter: '@acmeracing', linkedin: 'acme-racing-co', instagram: '@acmeracing', }, }; const MOCK_NOTIFICATIONS: NotificationSettings = { emailNewSponsorships: true, emailWeeklyReport: true, emailRaceAlerts: false, emailPaymentAlerts: true, emailNewOpportunities: true, emailContractExpiry: true, }; const MOCK_PRIVACY: PrivacySettings = { publicProfile: true, showStats: false, showActiveSponsorships: true, allowDirectContact: true, }; const INDUSTRY_OPTIONS = [ 'Racing Equipment', 'Automotive', 'Technology', 'Gaming & Esports', 'Energy Drinks', 'Apparel', 'Financial Services', 'Other', ]; // ============================================================================ // Components // ============================================================================ function SavedIndicator({ visible }: { visible: boolean }) { const shouldReduceMotion = useReducedMotion(); return ( Changes saved ); } // ============================================================================ // Main Component // ============================================================================ export default function SponsorSettingsPage() { const router = useRouter(); const shouldReduceMotion = useReducedMotion(); const [profile, setProfile] = useState(MOCK_PROFILE); const [notifications, setNotifications] = useState(MOCK_NOTIFICATIONS); const [privacy, setPrivacy] = useState(MOCK_PRIVACY); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const handleSaveProfile = async () => { setSaving(true); await new Promise(resolve => setTimeout(resolve, 800)); setSaving(false); setSaved(true); setTimeout(() => setSaved(false), 3000); }; const handleDeleteAccount = () => { if (confirm('Are you sure you want to delete your sponsor account? This action cannot be undone. All sponsorship data will be permanently removed.')) { document.cookie = 'gridpilot_demo_mode=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'; document.cookie = 'gridpilot_sponsor_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'; router.push('/'); } }; const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: shouldReduceMotion ? 0 : 0.1, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0 }, }; return ( {/* Header */} } /> {/* Company Profile */}
{/* Company Basic Info */}
setProfile({ ...profile, companyName: e.target.value })} placeholder="Your company name" />
{/* Contact Information */}

Contact Information

setProfile({ ...profile, contactName: e.target.value })} placeholder="Full name" /> setProfile({ ...profile, contactEmail: e.target.value })} placeholder="sponsor@company.com" /> setProfile({ ...profile, contactPhone: e.target.value })} placeholder="+1 (555) 123-4567" /> setProfile({ ...profile, website: e.target.value })} placeholder="https://company.com" />
{/* Address */}

Business Address

setProfile({ ...profile, address: { ...profile.address, street: e.target.value } })} placeholder="123 Main Street" />
setProfile({ ...profile, address: { ...profile.address, city: e.target.value } })} placeholder="City" /> setProfile({ ...profile, address: { ...profile.address, postalCode: e.target.value } })} placeholder="12345" /> setProfile({ ...profile, address: { ...profile.address, country: e.target.value } })} placeholder="Country" /> setProfile({ ...profile, taxId: e.target.value })} placeholder="XX12-3456789" />
{/* Description */}