From f25a4a783bc3152aac7972434a5f9bbede8cc75a Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 29 Apr 2026 19:48:30 +0000 Subject: [PATCH] Update src/app/page.tsx --- src/app/page.tsx | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index b44e773..4f41494 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ "use client"; +import { useState, useEffect } from "react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import ReactLenis from "lenis/react"; import BlogCardOne from '@/components/sections/blog/BlogCardOne'; @@ -15,6 +16,23 @@ import TestimonialCardSixteen from '@/components/sections/testimonial/Testimonia import { Award, Clock, Zap } from "lucide-react"; export default function LandingPage() { + const [liveScores, setLiveScores] = useState([]); + + useEffect(() => { + const fetchScores = async () => { + try { + const response = await fetch("https://api.the-sports-data.com/v1/scores?league=mlb,nfl,nba,nhl&team_region=new-york"); + const data = await response.json(); + setLiveScores(data.scores || []); + } catch (error) { + console.error("Error fetching scores:", error); + } + }; + fetchScores(); + const interval = setInterval(fetchScores, 30000); + return () => clearInterval(interval); + }, []); + return ( @@ -79,7 +90,7 @@ export default function LandingPage() { textboxLayout="split" useInvertedBackground={false} features={[ - { id: "f1", title: "Live Scoreboard", description: "Auto-refreshing scores every 30 seconds for the most accurate updates.", tag: "Live", imageSrc: "http://img.b2bpic.net/free-photo/soccer-fans-cheering-their-team_23-2151536148.jpg" }, + { id: "f1", title: "Live Scoreboard", description: liveScores.length > 0 ? "Latest scores retrieved successfully." : "Loading live scores...", tag: "Live", imageSrc: "http://img.b2bpic.net/free-photo/soccer-fans-cheering-their-team_23-2151536148.jpg" }, { id: "f2", title: "Multi-League Support", description: "Seamless tracking across MLB, NFL, NBA, and NHL.", tag: "Coverage", imageSrc: "http://img.b2bpic.net/free-photo/view-composition-with-neatly-arranged-organized-sport-items_23-2150275220.jpg" }, { id: "f3", title: "Breaking News", description: "The latest updates and trade rumors directly from NYC sports media.", tag: "Updates", imageSrc: "http://img.b2bpic.net/free-photo/physical-activity-stats-around-person_23-2150163381.jpg" }, ]} @@ -203,4 +214,4 @@ export default function LandingPage() { ); -} +} \ No newline at end of file -- 2.49.1