"use client"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleMinimal from '@/components/navbar/NavbarStyleMinimal'; import HeroLogoBillboardSplit from '@/components/sections/hero/HeroLogoBillboardSplit'; import AboutMetric from '@/components/sections/about/AboutMetric'; import FeatureCardNine from '@/components/sections/feature/FeatureCardNine'; import ProductCardFour from '@/components/sections/product/ProductCardFour'; import TestimonialCardNine from '@/components/sections/testimonial/TestimonialCardNine'; import FaqSplitText from '@/components/sections/faq/FaqSplitText'; import BlogCardTwo from '@/components/sections/blog/BlogCardTwo'; import ContactCenter from '@/components/sections/contact/ContactCenter'; import FooterBaseSocial from '@/components/sections/footer/FooterBaseSocial'; import { Flame, Users, CheckCircle, Heart, Sparkles, Mail, Instagram, Facebook, Youtube, Twitter } from "lucide-react"; import { loadStripe } from '@stripe/stripe-js'; import { useState } from 'react'; const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || ''); export default function LandingPage() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [email, setEmail] = useState(''); const [smsPhone, setSmsPhone] = useState(''); const handlePayment = async () => { try { setLoading(true); setError(null); const response = await fetch('/api/create-checkout-session', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ amount: 5000, }), }); if (!response.ok) { throw new Error('Failed to create checkout session'); } const { sessionId } = await response.json(); const stripe = await stripePromise; if (!stripe) { throw new Error('Stripe failed to load'); } const { error: redirectError } = await stripe.redirectToCheckout({ sessionId, }); if (redirectError) { setError(redirectError.message || 'Payment failed'); } } catch (err) { setError(err instanceof Error ? err.message : 'Payment error occurred'); } finally { setLoading(false); } }; const handleSignup = async (e: React.FormEvent) => { e.preventDefault(); try { setLoading(true); setError(null); const response = await fetch('/api/send-sms', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email, phone: smsPhone, }), }); if (!response.ok) { throw new Error('Failed to send SMS'); } setEmail(''); setSmsPhone(''); // Show success message or redirect as needed } catch (err) { setError(err instanceof Error ? err.message : 'Signup error occurred'); } finally { setLoading(false); } }; return (
{ // Handle newsletter signup console.log('Newsletter signup:', email); }} ariaLabel="Newsletter signup section" className="py-20 md:py-28" titleClassName="text-3xl md:text-5xl font-semibold" descriptionClassName="text-base md:text-lg" />

Sign Up & Get SMS Notification

Join our community and receive cooking updates via SMS.

setEmail(e.target.value)} required className="w-full px-4 py-2 bg-secondary-cta text-foreground rounded-full border border-accent/30 focus:outline-none focus:ring-2 focus:ring-primary-cta" />
setSmsPhone(e.target.value)} required className="w-full px-4 py-2 bg-secondary-cta text-foreground rounded-full border border-accent/30 focus:outline-none focus:ring-2 focus:ring-primary-cta" />
{error && (

{error}

)}

We'll send you a welcome SMS and cooking updates

Premium Experience

Get exclusive access to premium recipes and advanced meal planning features.

$50

One-time payment for lifetime access

{error && (

{error}

)}

Secure payment powered by Stripe

); }