import { useState, useEffect } from 'react' import { Link, Routes, Route, useNavigate } from 'react-router-dom' import AdminPage from './AdminPage' import './App.css' const SPOTIFY_SHOW_URL = 'https://open.spotify.com/show/0Gq1TzoJOdReSZ1gYQi8Xl' const SPOTIFY_EMBED_URL = 'https://open.spotify.com/embed/show/0Gq1TzoJOdReSZ1gYQi8Xl?utm_source=generator&theme=0' const SPOTIFY_CREATOR_URL = 'https://creators.spotify.com/pod/profile/nmemmert/' const APPLE_PODCASTS_URL = 'https://podcasts.apple.com/search?term=Verse+by+Verse+with+Nate' const YOUTUBE_URL = 'https://www.youtube.com/@blackzebraem5558' const AMAZON_MUSIC_URL = 'https://music.amazon.com/podcasts/202322bf-db86-4e7d-9a6b-4db7cbccbccf/verse-by-verse-with-nate' const FACEBOOK_URL = 'https://facebook.com/versebyversewithnate' const CONSENT_KEY = 'vbn_analytics_consent_choice' function FacebookIcon() { return ( ) } export interface CustomLink { id: string label: string url: string placement: 'platforms' | 'footer' | 'resources' } export interface CustomBlock { id: string heading: string body: string } export interface SiteContent { eyebrow: string heroTagline: string aboutShowHeading: string aboutShowP1: string aboutShowP2: string aboutNate: string seriesLabel: string seriesTitle: string seriesDescription: string studyGuideTitle: string studyGuideDescription: string studyGuideUrl: string shareHeading: string shareP: string customLinks: CustomLink[] customBlocks: CustomBlock[] } export const DEFAULTS: SiteContent = { eyebrow: 'A Journey Through Scripture', heroTagline: "Exploring God's Word one verse at a time", aboutShowHeading: 'Depth. Clarity. Application.', aboutShowP1: 'Verse by Verse with Nate walks through Scripture passage by passage — unpacking the original context, drawing out the meaning, and connecting each verse to how we live today.', aboutShowP2: "Whether you're in the car, at the gym, or just looking for something to anchor your day, each episode is designed to feed your faith with solid, practical teaching.", aboutNate: 'Nate Emmert is a husband, dad, and lifelong student of the Bible from Lynchburg, Va. He created Verse by Verse to share the joy of deep Scripture study in a format anyone can follow along with — no seminary required.', seriesLabel: 'Now Playing', seriesTitle: 'Study of Titus: Sound Doctrine', seriesDescription: "A deep-dive into Paul's letter to Titus — unpacking what it means to build a church and a life on sound doctrine.", studyGuideTitle: 'Companion Study Guide', studyGuideDescription: 'Go deeper in your study with the official Verse by Verse companion guide — now available on Amazon.', studyGuideUrl: 'https://a.co/d/01sG2tOJ', shareHeading: 'Help one more person hear the Word this week.', shareP: 'Scan the QR code or text the show link to a friend who needs encouragement today.', customLinks: [], customBlocks: [], } function SpotifyIcon() { return ( ) } function YouTubeIcon() { return ( ) } function AmazonMusicIcon() { return ( ) } function ContactForm() { const navigate = useNavigate() const [fields, setFields] = useState({ name: '', email: '', message: '', messageType: 'question' }) const [subscribe, setSubscribe] = useState(false) const [honey, setHoney] = useState('') const [status, setStatus] = useState<'idle' | 'submitting' | 'error'>('idle') const [errorMsg, setErrorMsg] = useState('') function handleChange(e: React.ChangeEvent) { setFields(f => ({ ...f, [e.target.name]: e.target.value })) } function handleSelectChange(e: React.ChangeEvent) { setFields(f => ({ ...f, [e.target.name]: e.target.value })) } async function handleSubmit(e: React.FormEvent) { e.preventDefault() setStatus('submitting') setErrorMsg('') try { const res = await fetch('/api/contact', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ...fields, subscribe, _honey: honey }), }) if (!res.ok) { const data = await res.json().catch(() => ({})) setErrorMsg((data as { message?: string }).message ?? 'Something went wrong. Please try again.') setStatus('error') return } navigate('/thanks') } catch { setErrorMsg('Could not connect. Please try again later.') setStatus('error') } } return (
setHoney(e.target.value)} />