"use client" import type React from "react" import Image from "next/image" import Link from "next/link" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { useState } from "react" export default function ContactPage() { const [isLoading, setIsLoading] = useState(false) const [formData, setFormData] = useState({ name: "", email: "", subject: "", message: "", }) const [isSubmitting, setIsSubmitting] = useState(false) const handleMonthlySponsorship = async () => { setIsLoading(true) try { console.log("[v0] Starting monthly sponsorship process") const response = await fetch("/api/create-checkout-session", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ priceId: "buck_a_month", sponsorTier: "Monthly Supporter", }), }) if (!response.ok) { const errorData = await response.json() throw new Error(errorData.error || "Failed to create checkout session") } const data = await response.json() // Open Stripe checkout in new tab to avoid ad blocker issues window.open(data.url, "_blank") } catch (error) { console.error("Error creating checkout session:", error) alert("There was an error processing your request. Please try again.") } finally { setIsLoading(false) } } const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setIsSubmitting(true) try { console.log("[v0] Submitting contact form:", formData) const response = await fetch("/api/send-email", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(formData), }) if (!response.ok) { const errorData = await response.json() throw new Error(errorData.error || "Failed to send message") } // Reset form on success setFormData({ name: "", email: "", subject: "", message: "" }) alert("Message sent successfully! Jerry will get back to you soon.") } catch (error) { console.error("Error sending message:", error) alert("There was an error sending your message. Please try again.") } finally { setIsSubmitting(false) } } const handleInputChange = (e: React.ChangeEvent) => { const { id, value } = e.target setFormData((prev) => ({ ...prev, [id]: value })) } return (
{/* Header */}

Welcome to

AlertBayTrumpeter.com!

{/* Navigation */}
{/* Contact Content */}

Get in Touch

{/* Contact Form */} Send Jerry a Message