import React, { useMemo, useState } from "react";
import { motion } from "framer-motion";
import { CalendarDays, Trophy, Clock3, Users, ChevronLeft, ChevronRight, MapPin } from "lucide-react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
const restaurantTeams = [
"Broters FC",
"Jose FC",
"Alves",
"Patricio",
"Saul",
"Gacio Doro",
"San Eduardo",
"Los Galacticos",
];
const regularTeams = [
"Yelsin FC",
"Enrique FC",
"Barrios FC",
"Brasil FC",
"Carlos FC",
"Romero",
"AJ & The Gang",
"Inter NY FC",
"Ricardo Portillo",
"New Team",
];
const restaurantSchedule = [
{
week: 1,
label: "Week 1",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Los Galacticos", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Jose FC", away: "San Eduardo", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Alves", away: "Gacio Doro", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Patricio", away: "Saul", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 2,
label: "Week 2",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "San Eduardo", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Los Galacticos", away: "Gacio Doro", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Jose FC", away: "Saul", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Alves", away: "Patricio", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 3,
label: "Week 3",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Gacio Doro", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "San Eduardo", away: "Saul", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Los Galacticos", away: "Patricio", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Jose FC", away: "Alves", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 4,
label: "Week 4",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Saul", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Gacio Doro", away: "Patricio", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "San Eduardo", away: "Alves", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Los Galacticos", away: "Jose FC", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 5,
label: "Week 5",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Patricio", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Saul", away: "Alves", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Gacio Doro", away: "Jose FC", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "San Eduardo", away: "Los Galacticos", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 6,
label: "Week 6",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Alves", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Patricio", away: "Jose FC", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Saul", away: "Los Galacticos", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Gacio Doro", away: "San Eduardo", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 7,
label: "Week 7",
games: [
{ day: "Monday", time: "10:30 PM", home: "Broters FC", away: "Jose FC", location: "Main Turf", note: "League Night" },
{ day: "Wednesday", time: "10:30 PM", home: "Alves", away: "Los Galacticos", location: "Main Turf", note: "Alves Donated Slot" },
{ day: "Thursday", time: "10:30 PM", home: "Patricio", away: "San Eduardo", location: "Main Turf", note: "League Night" },
{ day: "Friday", time: "9:30 PM", home: "Saul", away: "Gacio Doro", location: "Main Turf", note: "Kevin / Galacticos Slot" },
],
},
{
week: 8,
label: "Week 8 Β· Semifinals",
games: [
{ day: "Wednesday", time: "10:30 PM", home: "1 Seed", away: "4 Seed", location: "Main Turf", note: "Semifinal" },
{ day: "Friday", time: "9:30 PM", home: "2 Seed", away: "3 Seed", location: "Main Turf", note: "Semifinal" },
],
},
{
week: 9,
label: "Week 9 Β· Finals",
games: [
{ day: "Wednesday", time: "10:30 PM", home: "3rd Place", away: "3rd Place", location: "Main Turf", note: "Placement Match" },
{ day: "Friday", time: "9:30 PM", home: "Championship Final", away: "Championship Final", location: "Main Turf", note: "Final" },
],
},
];
const regularSchedule = [
{
week: 1,
label: "Week 1",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "New Team", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Enrique FC", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Brasil FC", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Romero", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "Ricardo Portillo", away: "Enrique FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Brasil FC", away: "Romero", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Carlos FC", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 2,
label: "Week 2",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Romero", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Brasil FC", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "New Team", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Enrique FC", away: "Brasil FC", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Yelsin FC", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 3,
label: "Week 3",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Romero", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "AJ & The Gang", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Brasil FC", away: "New Team", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "Carlos FC", away: "Romero", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "AJ & The Gang", away: "Ricardo Portillo", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "New Team", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 4,
label: "Week 4",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Ricardo Portillo", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "New Team", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Brasil FC", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "Romero", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Yelsin FC", away: "Enrique FC", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Barrios FC", location: "Field A", note: "Barrios Friday Override" },
],
},
{
week: 5,
label: "Week 5",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "New Team", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "Brasil FC", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Carlos FC", away: "Romero", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "AJ & The Gang", away: "Enrique FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Brasil FC", away: "New Team", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Ricardo Portillo", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 6,
label: "Week 6",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Enrique FC", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Brasil FC", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Carlos FC", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Romero", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "New Team", away: "Brasil FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Carlos FC", away: "Romero", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "AJ & The Gang", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 7,
label: "Week 7",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Brasil FC", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Carlos FC", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "Romero", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "AJ & The Gang", away: "New Team", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "Ricardo Portillo", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Enrique FC", away: "Romero", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Brasil FC", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 8,
label: "Week 8",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Carlos FC", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "Romero", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "AJ & The Gang", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Brasil FC", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "New Team", away: "Yelsin FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Enrique FC", away: "AJ & The Gang", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Ricardo Portillo", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 9,
label: "Week 9",
games: [
{ day: "Monday", time: "7:00 PM", home: "Yelsin FC", away: "Romero", location: "Field A", note: "Regular Season" },
{ day: "Monday", time: "8:00 PM", home: "Barrios FC", away: "AJ & The Gang", location: "Field A", note: "Barrios Fixed Slot" },
{ day: "Tuesday", time: "7:00 PM", home: "Enrique FC", away: "Ricardo Portillo", location: "Field A", note: "Regular Season" },
{ day: "Tuesday", time: "8:00 PM", home: "Brasil FC", away: "New Team", location: "Field A", note: "Regular Season" },
{ day: "Wednesday", time: "7:00 PM", home: "Carlos FC", away: "Yelsin FC", location: "Field A", note: "Regular Season" },
{ day: "Friday", time: "7:00 PM", home: "Brasil FC", away: "Carlos FC", location: "Field A", note: "Friday Night" },
{ day: "Friday", time: "8:00 PM", home: "Inter NY FC", away: "Enrique FC", location: "Field A", note: "Inter NY FC Fixed Slot" },
],
},
{
week: 10,
label: "Week 10 Β· Playoffs",
games: [
{ day: "Friday", time: "7:00 PM", home: "1 Seed", away: "4 Seed", location: "Field A", note: "Semifinal" },
{ day: "Friday", time: "8:00 PM", home: "2 Seed", away: "3 Seed", location: "Field A", note: "Semifinal" },
],
},
{
week: 11,
label: "Week 11 Β· Finals",
games: [
{ day: "Friday", time: "7:00 PM", home: "3rd Place Game", away: "TBD", location: "Field A", note: "Placement Match" },
{ day: "Friday", time: "8:00 PM", home: "Championship Final", away: "TBD", location: "Field A", note: "Final" },
],
},
];
const leagueMeta = {
regular: {
title: "Regular League",
color: "from-sky-500 via-blue-600 to-indigo-700",
accent: "bg-sky-500/15 text-sky-200 border-sky-400/20",
teams: regularTeams,
season: regularSchedule,
summary: ["10 Teams", "9 Regular Season Weeks", "Top 4 Playoffs", "Inter NY FC fixed Fridays", "Barrios fixed Monday 8 PM"],
},
restaurant: {
title: "Restaurant League",
color: "from-amber-500 via-orange-600 to-rose-700",
accent: "bg-amber-500/15 text-amber-100 border-amber-400/20",
teams: restaurantTeams,
season: restaurantSchedule,
summary: ["8 Teams", "7 Regular Season Weeks", "Top 4 Playoffs", "Friday 9:30 PM feature match", "Alves and Galacticos donated slots"],
},
};
function groupByDay(games) {
const dayOrder = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
const grouped = games.reduce((acc, game) => {
if (!acc[game.day]) acc[game.day] = [];
acc[game.day].push(game);
return acc;
}, {});
return dayOrder.filter((day) => grouped[day]).map((day) => ({ day, games: grouped[day] }));
}
function StatPill({ icon: Icon, label }) {
return (
);
}
function MatchCard({ game, large = false }) {
return (
{game.time}
{game.note}
{game.home}
vs
{game.away}
{game.location}
);
}
function WeekGrid({ weekData }) {
const grouped = useMemo(() => groupByDay(weekData.games), [weekData]);
return (
{grouped.map((group) => (
{group.day}
{group.games.length} {group.games.length === 1 ? "game" : "games"}
{group.games.map((game, idx) => (
))}
))}
);
}
function TeamList({ teams }) {
return (
{teams.map((team) => (
{team}
))}
);
}
function LeagueView({ leagueKey }) {
const meta = leagueMeta[leagueKey];
const [weekIndex, setWeekIndex] = useState(0);
const [view, setView] = useState("calendar");
const currentWeek = meta.season[weekIndex];
const nextWeek = () => setWeekIndex((prev) => Math.min(prev + 1, meta.season.length - 1));
const prevWeek = () => setWeekIndex((prev) => Math.max(prev - 1, 0));
return (
League Calendar System
{meta.title}
Interactive weekly schedule view with team list, playoff weeks, and a cleaner way to present the full season.
{meta.summary.map((item) => (
{item}
))}
Season Controls
Switch between week views or browse the teams in this division.
Calendar
Teams
setWeekIndex(Number(val))}>
{meta.season.map((week, index) => (
{week.label}
))}
{view === "calendar" ? (
<>
Current view
{currentWeek.label}
Prev
Next
>
) : (
League Teams
Roster list for this division.
)}
);
}
export default function LeagueCalendarDashboard() {
return (
US Academy Leagues
Interactive League Calendar
Separate systems for the Regular League and Restaurant League, built for presentation, weekly navigation, and a clean visual schedule view.
Regular League
Restaurant League
);
}