From d8230dda2a56a0e009d3a6f15bdfe20c7dbafcd5 Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 11 Jun 2026 10:39:14 +0000 Subject: [PATCH] Add src/app/matches/[id]/page.tsx --- src/app/matches/[id]/page.tsx | 220 ++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 src/app/matches/[id]/page.tsx diff --git a/src/app/matches/[id]/page.tsx b/src/app/matches/[id]/page.tsx new file mode 100644 index 0000000..3d845c7 --- /dev/null +++ b/src/app/matches/[id]/page.tsx @@ -0,0 +1,220 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import { useParams, useRouter } from 'next/navigation'; +import React from 'react'; +import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay'; +import FooterBaseReveal from '@/components/sections/footer/FooterBaseReveal'; + +interface GoalScorer { + name: string; + minute: number; +} + +interface Match { + id: string; + homeTeam: string; + awayTeam: string; + homeScore: number; + awayScore: number; + date: string; + venue: string; + tournamentStage: string; + goalScorers: GoalScorer[]; + imageSrc: string; + imageAlt: string; +} + +const dummyMatchData: Record = { + "match-1": { + id: "match-1", homeTeam: "Argentina", awayTeam: "France", homeScore: 3, + awayScore: 3, + date: "December 18, 2022", venue: "Lusail Stadium, Qatar", tournamentStage: "2022 Final", goalScorers: [ + { name: "Lionel Messi (ARG)", minute: 23 }, + { name: "Ángel Di María (ARG)", minute: 36 }, + { name: "Kylian Mbappé (FRA)", minute: 80 }, + { name: "Kylian Mbappé (FRA)", minute: 81 }, + { name: "Lionel Messi (ARG)", minute: 108 }, + { name: "Kylian Mbappé (FRA)", minute: 118 }, + ], + imageSrc: "http://img.b2bpic.net/free-photo/spain-vs-switzerland_187299-31172.jpg", imageAlt: "Argentina vs France World Cup Final 2022" + }, + "match-2": { + id: "match-2", homeTeam: "Brazil", awayTeam: "Germany", homeScore: 1, + awayScore: 7, + date: "July 8, 2014", venue: "Estádio Mineirão, Brazil", tournamentStage: "2014 Semi-final", goalScorers: [ + { name: "Thomas Müller (GER)", minute: 11 }, + { name: "Miroslav Klose (GER)", minute: 23 }, + { name: "Toni Kroos (GER)", minute: 24 }, + { name: "Toni Kroos (GER)", minute: 26 }, + { name: "Sami Khedira (GER)", minute: 29 }, + { name: "André Schürrle (GER)", minute: 69 }, + { name: "André Schürrle (GER)", minute: 79 }, + { name: "Oscar (BRA)", minute: 90 }, + ], + imageSrc: "http://img.b2bpic.net/free-photo/ghana-vs-croatia-football_187299-32095.jpg", imageAlt: "Brazil vs Germany World Cup Semi-final 2014" + }, + "match-3": { + id: "match-3", homeTeam: "Italy", awayTeam: "Brazil", homeScore: 0, + awayScore: 0, + date: "July 17, 1994", venue: "Rose Bowl, USA", tournamentStage: "1994 Final", goalScorers: [], // No goals in regular/extra time + imageSrc: "http://img.b2bpic.net/free-photo/soccer-fans-cheering-their-team-stadium_23-2151536180.jpg", imageAlt: "Italy vs Brazil World Cup Final 1994" + }, + "match-4": { + id: "match-4", homeTeam: "England", awayTeam: "Germany", homeScore: 1, + awayScore: 4, + date: "June 27, 2010", venue: "Free State Stadium, South Africa", tournamentStage: "2010 Round of 16", goalScorers: [ + { name: "Miroslav Klose (GER)", minute: 20 }, + { name: "Lukas Podolski (GER)", minute: 32 }, + { name: "Matthew Upson (ENG)", minute: 37 }, + { name: "Thomas Müller (GER)", minute: 67 }, + { name: "Thomas Müller (GER)", minute: 70 }, + ], + imageSrc: "http://img.b2bpic.net/free-photo/men-playing-rugby-field_23-2150062039.jpg", imageAlt: "England vs Germany World Cup 2010" + }, + "match-5": { + id: "match-5", homeTeam: "Spain", awayTeam: "Netherlands", homeScore: 1, + awayScore: 0, + date: "July 11, 2010", venue: "Soccer City, South Africa", tournamentStage: "2010 Final", goalScorers: [ + { name: "Andrés Iniesta (ESP)", minute: 116 }, + ], + imageSrc: "http://img.b2bpic.net/free-photo/soccer-game-concept_23-2151043781.jpg", imageAlt: "Spain vs Netherlands World Cup Final 2010" + }, + "match-6": { + id: "match-6", homeTeam: "USA", awayTeam: "Mexico", homeScore: 2, + awayScore: 0, + date: "June 17, 2002", venue: "Jeonju World Cup Stadium, South Korea", tournamentStage: "2002 Round of 16", goalScorers: [ + { name: "Brian McBride (USA)", minute: 8 }, + { name: "Landon Donovan (USA)", minute: 65 }, + ], + imageSrc: "http://img.b2bpic.net/free-photo/morocco-vs-united-states-football_187299-32225.jpg", imageAlt: "USA vs Mexico World Cup 2002" + }, +}; + +export default function MatchDetailPage() { + const params = useParams(); + const matchId = params.id as string; + const match = dummyMatchData[matchId]; + + if (!match) { + return ( + + +
+

Match Not Found

+

The match you are looking for does not exist.

+
+ +
+ ); + } + + return ( + + +
+
+

+ Match Details: {match.homeTeam} vs {match.awayTeam} +

+ {match.imageAlt} + +
+

{match.tournamentStage}

+

{match.date} at {match.venue}

+
+ {match.homeTeam} + {match.homeScore} - {match.awayScore} + {match.awayTeam} +
+
+ + {match.goalScorers.length > 0 && ( +
+

Goal Scorers

+
    + {match.goalScorers.map((scorer, index) => ( +
  • + {scorer.name} + {scorer.minute}' +
  • + ))} +
+
+ )} + {match.goalScorers.length === 0 && ( +
+

No Goals Scored in Regular Time

+

This match was decided by other means (e.g., penalty shootout).

+
+ )} +
+
+ +
+ ); +}