"use client" import type React from "react" import { useState } from "react" export default function SiteFooter() { const [email, setEmail] = useState("") const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (!email.trim()) { alert('Please enter a valid email address') return } try { const response = await fetch('/api/mailchimp/subscribe', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email }), }) const result = await response.json() if (result.success) { alert('Thank you for subscribing! Check your email for confirmation.') setEmail('') } else { alert(result.error || 'Subscription failed. Please try again.') } } catch (error) { console.error('Subscription error:', error) alert('Something went wrong. Please try again later.') } } return ( ) }