diff --git a/src/app/page.tsx b/src/app/page.tsx index ec98d5f..fa53527 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,6 +2,7 @@ import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import ReactLenis from "lenis/react"; +import { useState, useCallback } from "react"; import ContactCenter from '@/components/sections/contact/ContactCenter'; import FaqDouble from '@/components/sections/faq/FaqDouble'; import FeatureCardSixteen from '@/components/sections/feature/FeatureCardSixteen'; @@ -11,8 +12,29 @@ import MetricCardSeven from '@/components/sections/metrics/MetricCardSeven'; import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay'; import SocialProofOne from '@/components/sections/socialProof/SocialProofOne'; import TestimonialCardTwelve from '@/components/sections/testimonial/TestimonialCardTwelve'; +import Input from '@/components/form/Input'; export default function LandingPage() { + const [searchQuery, setSearchQuery] = useState(""); + const [loading, setLoading] = useState(false); + const [results, setResults] = useState([]); + const [error, setError] = useState(null); + + const handleSearch = useCallback(async () => { + setLoading(true); + setError(null); + try { + const response = await fetch(`/api/search?q=${encodeURIComponent(searchQuery)}`); + if (!response.ok) throw new Error('Search failed'); + const data = await response.json(); + setResults(data.items || []); + } catch (err) { + setError('Unable to fetch results. Please try again.'); + } finally { + setLoading(false); + } + }, [searchQuery]); + return ( @@ -53,20 +63,26 @@ export default function LandingPage() {
+
+
+ + +
+ {error &&

{error}

} +
@@ -74,22 +90,8 @@ export default function LandingPage() { animationType="slide-up" textboxLayout="default" useInvertedBackground={true} - negativeCard={{ - items: [ - "Manual searching", - "Outdated databases", - "Cold outreach spam", - "Low conversion waste", - ], - }} - positiveCard={{ - items: [ - "Real-time data", - "Outreach ready leads", - "Automatic AI agents", - "High response rates", - ], - }} + negativeCard={{ items: ["Manual searching", "Outdated databases", "Cold outreach spam", "Low conversion waste"] }} + positiveCard={{ items: ["Real-time data", "Outreach ready leads", "Automatic AI agents", "High response rates"] }} title="Turn high-intent leads into revenue" description="Businesses without websites are often easier to approach and higher intent for digital services." /> @@ -101,33 +103,9 @@ export default function LandingPage() { textboxLayout="default" useInvertedBackground={false} metrics={[ - { - id: "m1", - value: "10M+", - title: "Scraped Records", - items: [ - "Deep web indexing", - "Real-time updates", - ], - }, - { - id: "m2", - value: "95%", - title: "Lead Accuracy", - items: [ - "Verified phone numbers", - "Direct local contact", - ], - }, - { - id: "m3", - value: "24/7", - title: "AI Agent Tracking", - items: [ - "Continuous prospecting", - "Automated pipeline", - ], - }, + { id: "m1", value: "10M+", title: "Scraped Records", items: ["Deep web indexing", "Real-time updates"] }, + { id: "m2", value: "95%", title: "Lead Accuracy", items: ["Verified phone numbers", "Direct local contact"] }, + { id: "m3", value: "24/7", title: "AI Agent Tracking", items: ["Continuous prospecting", "Automated pipeline"] }, ]} title="Data backed results" description="Our platform constantly scrapes millions of records to find your next best client." @@ -138,15 +116,7 @@ export default function LandingPage() { @@ -156,31 +126,9 @@ export default function LandingPage() { @@ -273,4 +172,4 @@ export default function LandingPage() { ); -} +} \ No newline at end of file