405 lines
14 KiB
TypeScript
405 lines
14 KiB
TypeScript
export type Market = {
|
||
id: string;
|
||
label: string;
|
||
odds: number;
|
||
};
|
||
|
||
export type Event = {
|
||
id: string;
|
||
sport: string;
|
||
sportIcon: string;
|
||
league: string;
|
||
country: string;
|
||
homeTeam: string;
|
||
awayTeam: string;
|
||
time: string;
|
||
date: string; // Added date for grouping
|
||
isLive: boolean;
|
||
liveMinute?: number;
|
||
homeScore?: number;
|
||
awayScore?: number;
|
||
markets: Market[];
|
||
totalMarkets: number;
|
||
};
|
||
|
||
export type SportCategory = {
|
||
id: string;
|
||
name: string;
|
||
icon: string;
|
||
count: number;
|
||
};
|
||
|
||
export const sportCategories: SportCategory[] = [
|
||
{ id: "soccer", name: "Soccer", icon: "⚽", count: 142 },
|
||
{ id: "basketball", name: "Basketball", icon: "🏀", count: 38 },
|
||
{ id: "tennis", name: "Tennis", icon: "🎾", count: 26 },
|
||
{ id: "ice-hockey", name: "Ice Hockey", icon: "🏒", count: 18 },
|
||
{ id: "volleyball", name: "Volleyball", icon: "🏐", count: 14 },
|
||
{ id: "handball", name: "Handball", icon: "🤾", count: 12 },
|
||
{ id: "baseball", name: "Baseball", icon: "⚾", count: 8 },
|
||
{ id: "american-football", name: "American Football", icon: "🏈", count: 6 },
|
||
{ id: "cricket", name: "Cricket", icon: "🏏", count: 4 },
|
||
{ id: "rugby", name: "Rugby", icon: "🏉", count: 3 },
|
||
{ id: "boxing", name: "Boxing", icon: "🥊", count: 2 },
|
||
{ id: "esports", name: "E-Sports", icon: "🎮", count: 22 },
|
||
];
|
||
|
||
export const mockEvents: Event[] = [
|
||
{
|
||
id: "01682",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga",
|
||
country: "Spain",
|
||
homeTeam: "Athletic Bilbao",
|
||
awayTeam: "Elche CF",
|
||
time: "11:00",
|
||
date: "Feb 20, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 1.64 },
|
||
{ id: "x", label: "x", odds: 3.91 },
|
||
{ id: "2", label: "2", odds: 5.45 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.93 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.88 },
|
||
{ id: "1x", label: "1X", odds: 1.15 },
|
||
{ id: "12", label: "12", odds: 1.24 },
|
||
{ id: "x2", label: "X2", odds: 2.13 },
|
||
{ id: "yes", label: "Yes", odds: 1.96 },
|
||
{ id: "no", label: "No", odds: 1.86 },
|
||
],
|
||
totalMarkets: 112,
|
||
},
|
||
{
|
||
id: "01570",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga",
|
||
country: "Spain",
|
||
homeTeam: "Real Sociedad",
|
||
awayTeam: "Real Oviedo",
|
||
time: "04:00",
|
||
date: "Feb 21, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 1.52 },
|
||
{ id: "x", label: "x", odds: 4.41 },
|
||
{ id: "2", label: "2", odds: 6.91 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.98 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.87 },
|
||
{ id: "1x", label: "1X", odds: 1.11 },
|
||
{ id: "12", label: "12", odds: 1.21 },
|
||
{ id: "x2", label: "X2", odds: 2.43 },
|
||
{ id: "yes", label: "Yes", odds: 2.15 },
|
||
{ id: "no", label: "No", odds: 1.72 },
|
||
],
|
||
totalMarkets: 98,
|
||
},
|
||
{
|
||
id: "01541",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga",
|
||
country: "Spain",
|
||
homeTeam: "Betis",
|
||
awayTeam: "Rayo Vallecano",
|
||
time: "06:15",
|
||
date: "Feb 21, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 1.92 },
|
||
{ id: "x", label: "x", odds: 3.55 },
|
||
{ id: "2", label: "2", odds: 4.10 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.92 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.88 },
|
||
{ id: "1x", label: "1X", odds: 1.23 },
|
||
{ id: "12", label: "12", odds: 1.28 },
|
||
{ id: "x2", label: "X2", odds: 1.80 },
|
||
{ id: "yes", label: "Yes", odds: 1.81 },
|
||
{ id: "no", label: "No", odds: 2.00 },
|
||
],
|
||
totalMarkets: 104,
|
||
},
|
||
{
|
||
id: "01605",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga",
|
||
country: "Spain",
|
||
homeTeam: "Osasuna",
|
||
awayTeam: "Real Madrid",
|
||
time: "08:30",
|
||
date: "Feb 21, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 4.73 },
|
||
{ id: "x", label: "x", odds: 4.05 },
|
||
{ id: "2", label: "2", odds: 1.69 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.67 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 2.20 },
|
||
{ id: "1x", label: "1X", odds: 2.03 },
|
||
{ id: "12", label: "12", odds: 1.23 },
|
||
{ id: "x2", label: "X2", odds: 1.18 },
|
||
{ id: "yes", label: "Yes", odds: 1.70 },
|
||
{ id: "no", label: "No", odds: 2.15 },
|
||
],
|
||
totalMarkets: 128,
|
||
},
|
||
{
|
||
id: "01604",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga",
|
||
country: "Spain",
|
||
homeTeam: "Atletico Madrid",
|
||
awayTeam: "Espanyol",
|
||
time: "11:00",
|
||
date: "Feb 21, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 1.51 },
|
||
{ id: "x", label: "x", odds: 4.57 },
|
||
{ id: "2", label: "2", odds: 6.81 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.88 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.96 },
|
||
{ id: "1x", label: "1X", odds: 1.11 },
|
||
{ id: "12", label: "12", odds: 1.20 },
|
||
{ id: "x2", label: "X2", odds: 2.43 },
|
||
{ id: "yes", label: "Yes", odds: 2.05 },
|
||
{ id: "no", label: "No", odds: 1.78 },
|
||
],
|
||
totalMarkets: 156,
|
||
},
|
||
{
|
||
id: "01672",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "Ligue 1",
|
||
country: "France",
|
||
homeTeam: "Brest",
|
||
awayTeam: "Marseille",
|
||
time: "10:45",
|
||
date: "Feb 20, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 3.91 },
|
||
{ id: "x", label: "x", odds: 3.80 },
|
||
{ id: "2", label: "2", odds: 1.97 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.75 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 2.15 },
|
||
{ id: "1x", label: "1X", odds: 1.80 },
|
||
{ id: "12", label: "12", odds: 1.27 },
|
||
{ id: "x2", label: "X2", odds: 1.26 },
|
||
{ id: "yes", label: "Yes", odds: 1.67 },
|
||
{ id: "no", label: "No", odds: 2.20 },
|
||
],
|
||
totalMarkets: 142,
|
||
},
|
||
{
|
||
id: "00241",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "LaLiga 2",
|
||
country: "Spain",
|
||
homeTeam: "AD Ceuta",
|
||
awayTeam: "Granada",
|
||
time: "10:30",
|
||
date: "Feb 20, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 2.55 },
|
||
{ id: "x", label: "x", odds: 3.20 },
|
||
{ id: "2", label: "2", odds: 2.75 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 2.15 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.66 },
|
||
{ id: "1x", label: "1X", odds: 1.40 },
|
||
{ id: "12", label: "12", odds: 1.32 },
|
||
{ id: "x2", label: "X2", odds: 1.45 },
|
||
{ id: "yes", label: "Yes", odds: 1.85 },
|
||
{ id: "no", label: "No", odds: 1.85 },
|
||
],
|
||
totalMarkets: 110,
|
||
},
|
||
{
|
||
id: "01890",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "Premier League",
|
||
country: "England",
|
||
homeTeam: "Burnley",
|
||
awayTeam: "Brentford",
|
||
time: "05:00",
|
||
date: "Feb 28, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 4.58 },
|
||
{ id: "x", label: "x", odds: 4.00 },
|
||
{ id: "2", label: "2", odds: 1.78 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.80 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 2.05 },
|
||
{ id: "1x", label: "1X", odds: 2.10 },
|
||
{ id: "12", label: "12", odds: 1.25 },
|
||
{ id: "x2", label: "X2", odds: 1.20 },
|
||
{ id: "yes", label: "Yes", odds: 1.71 },
|
||
{ id: "no", label: "No", odds: 2.15 },
|
||
],
|
||
totalMarkets: 112,
|
||
},
|
||
{
|
||
id: "01124",
|
||
sport: "Soccer",
|
||
sportIcon: "⚽",
|
||
league: "Bundesliga",
|
||
country: "Germany",
|
||
homeTeam: "Mainz",
|
||
awayTeam: "Hamburger SV",
|
||
time: "10:30",
|
||
date: "Feb 20, 26",
|
||
isLive: false,
|
||
markets: [
|
||
{ id: "1", label: "1", odds: 2.11 },
|
||
{ id: "x", label: "x", odds: 3.40 },
|
||
{ id: "2", label: "2", odds: 3.58 },
|
||
{ id: "o25", label: "Over (2.5)", odds: 1.85 },
|
||
{ id: "u25", label: "Under (2.5)", odds: 1.96 },
|
||
{ id: "1x", label: "1X", odds: 1.28 },
|
||
{ id: "12", label: "12", odds: 1.30 },
|
||
{ id: "x2", label: "X2", odds: 1.66 },
|
||
{ id: "yes", label: "Yes", odds: 1.71 },
|
||
{ id: "no", label: "No", odds: 2.15 },
|
||
],
|
||
totalMarkets: 125,
|
||
},
|
||
];
|
||
|
||
export function getEventById(id: string): Event | undefined {
|
||
return mockEvents.find((e) => e.id === id)
|
||
}
|
||
|
||
export type DetailMarketOutcome = { label: string; odds: number }
|
||
export type DetailMarketSection = {
|
||
id: string
|
||
title: string
|
||
outcomes: DetailMarketOutcome[]
|
||
}
|
||
|
||
export function getEventDetailMarkets(eventId: string): DetailMarketSection[] {
|
||
const event = getEventById(eventId)
|
||
if (!event) return []
|
||
return [
|
||
{
|
||
id: "1x2",
|
||
title: "1x2",
|
||
outcomes: [
|
||
{ label: "Home", odds: 4.58 },
|
||
{ label: "Draw", odds: 4.0 },
|
||
{ label: "Away", odds: 1.78 },
|
||
],
|
||
},
|
||
{
|
||
id: "total",
|
||
title: "Total",
|
||
outcomes: [
|
||
{ label: "Over (2.5)", odds: 1.8 },
|
||
{ label: "Under (2.5)", odds: 2.05 },
|
||
],
|
||
},
|
||
{
|
||
id: "draw-no-bet",
|
||
title: "Draw No Bet",
|
||
outcomes: [
|
||
{ label: "Home", odds: 3.25 },
|
||
{ label: "Away", odds: 1.35 },
|
||
],
|
||
},
|
||
{
|
||
id: "asian-handicap",
|
||
title: "Asian Handicap 0.5",
|
||
outcomes: [
|
||
{ label: "Home (+0.5)", odds: 2.1 },
|
||
{ label: "Away (-0.5)", odds: 1.76 },
|
||
],
|
||
},
|
||
{
|
||
id: "double-chance",
|
||
title: "Double Chance",
|
||
outcomes: [
|
||
{ label: "Home or Draw", odds: 1.96 },
|
||
{ label: "Home or Away", odds: 1.25 },
|
||
{ label: "Draw or Away", odds: 1.2 },
|
||
],
|
||
},
|
||
{
|
||
id: "btts",
|
||
title: "Both teams to score",
|
||
outcomes: [
|
||
{ label: "Yes", odds: 1.71 },
|
||
{ label: "No", odds: 2.15 },
|
||
],
|
||
},
|
||
{
|
||
id: "1st-half-1x2",
|
||
title: "1st Half - 1X2",
|
||
outcomes: [
|
||
{ label: "Home", odds: 4.8 },
|
||
{ label: "Draw", odds: 2.4 },
|
||
{ label: "Away", odds: 2.3 },
|
||
],
|
||
},
|
||
]
|
||
}
|
||
|
||
/** Cards/Bookings markets: left column and right column of sections */
|
||
export function getCardsBookingsMarkets(eventId: string): {
|
||
left: DetailMarketSection[]
|
||
right: DetailMarketSection[]
|
||
} {
|
||
getEventById(eventId) // ensure event exists
|
||
return {
|
||
left: [
|
||
{ id: "bookings-1x2", title: "Bookings 1X2", outcomes: [{ label: "Home", odds: 2.2 }, { label: "Draw", odds: 3.7 }, { label: "Away", odds: 2.5 }] },
|
||
{ id: "bookings-ou", title: "Bookings - Over/Under", outcomes: [] },
|
||
{ id: "sending-off", title: "Sending Off", outcomes: [{ label: "Yes", odds: 5.4 }, { label: "No", odds: 1.12 }] },
|
||
{ id: "1st-half-bookings-ou", title: "1st Half Bookings - Over/Under", outcomes: [] },
|
||
{ id: "1st-booking", title: "1st Booking", outcomes: [{ label: "Home", odds: 1.79 }, { label: "None", odds: 28.11 }, { label: "Away", odds: 1.9 }] },
|
||
{ id: "home-exact-bookings", title: "Home Exact Bookings", outcomes: [] },
|
||
{ id: "1st-half-bookings-1x2", title: "1st Half - Bookings 1X2", outcomes: [{ label: "Home", odds: 2.95 }, { label: "Draw", odds: 2.15 }, { label: "Away", odds: 3.2 }] },
|
||
{ id: "1st-half-away-exact", title: "1st Half - Away Exact Bookings", outcomes: [] },
|
||
{ id: "away-sending-off", title: "Away Sending Off", outcomes: [] },
|
||
{ id: "1st-half-home-sending", title: "1st Half - Home Sending Off", outcomes: [] },
|
||
],
|
||
right: [
|
||
{
|
||
id: "booking-points-ou",
|
||
title: "Booking Points-Over/Under",
|
||
outcomes: [
|
||
{ label: "Over 35.5", odds: 1.85 }, { label: "Under 35.5", odds: 1.85 },
|
||
{ label: "Over 45.5", odds: 2.85 }, { label: "Under 45.5", odds: 1.38 },
|
||
{ label: "Over 55.5", odds: 4.6 }, { label: "Under 55.5", odds: 1.16 },
|
||
{ label: "Over 15.5", odds: 1.1 }, { label: "Under 15.5", odds: 5.8 },
|
||
{ label: "Over 25.5", odds: 1.35 }, { label: "Under 25.5", odds: 2.95 },
|
||
],
|
||
},
|
||
{ id: "exact-bookings", title: "Exact Bookings", outcomes: [] },
|
||
{ id: "1st-half-total-points", title: "1st Half - Total Booking Points", outcomes: [] },
|
||
{ id: "1st-half-exact-bookings", title: "1st Half - Exact Bookings", outcomes: [] },
|
||
{ id: "1st-half-1st-booking", title: "1st Half - 1st Booking", outcomes: [{ label: "Home", odds: 2.5 }, { label: "None", odds: 2.95 }, { label: "Away", odds: 2.65 }] },
|
||
{ id: "away-exact-bookings", title: "Away Exact Bookings", outcomes: [] },
|
||
{ id: "1st-half-home-exact", title: "1st Half - Home Exact Bookings", outcomes: [] },
|
||
{ id: "home-sending-off", title: "Home Sending Off", outcomes: [] },
|
||
],
|
||
}
|
||
}
|
||
|
||
export const popularLeagues = [
|
||
{ id: "ucl", name: "UEFA Champions League", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/b/bf/UEFA_Champions_League_logo_2.svg/300px-UEFA_Champions_League_logo_2.svg.png" },
|
||
{ id: "uel", name: "UEFA Europa League", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/0/0c/UEFA_Europa_League_logo_%282021%29.svg/300px-UEFA_Europa_League_logo_%282021%29.svg.png" },
|
||
{ id: "epl", name: "Premier League", country: "England", icon: "🏴", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/f/f2/Premier_League_Logo.svg/300px-Premier_League_Logo.svg.png" },
|
||
{ id: "laliga", name: "La Liga", country: "Spain", icon: "🇪<>", logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/LaLiga_logo_2023.svg/300px-LaLiga_logo_2023.svg.png" },
|
||
{ id: "laliga2", name: "LaLiga 2", country: "Spain", icon: "🇪🇸", logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/LaLiga_logo_2023.svg/300px-LaLiga_logo_2023.svg.png" },
|
||
{ id: "bundesliga", name: "Bundesliga", country: "Germany", icon: "🇩🇪", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/d/df/Bundesliga_logo_%282017%29.svg/300px-Bundesliga_logo_%282017%29.svg.png" },
|
||
{ id: "seriea", name: "Serie A", country: "Italy", icon: "🇮🇹", logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Serie_A_logo_%282019%29.svg/300px-Serie_A_logo_%282019%29.svg.png" },
|
||
{ id: "ligue1", name: "Ligue 1", country: "France", icon: "🇫🇷", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/d/d4/Ligue_1_Uber_Eats_logo.svg/300px-Ligue_1_Uber_Eats_logo.svg.png" },
|
||
{ id: "ligue2", name: "Ligue 2", country: "France", icon: "<22><>", logo: "https://upload.wikimedia.org/wikipedia/en/thumb/9/91/Ligue_2_logo_2020.svg/300px-Ligue_2_logo_2020.svg.png" },
|
||
{ id: "eredivisie", name: "Eredivisie", country: "Netherlands", icon: "<22><>", logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Eredivisie_logo_2017.svg/300px-Eredivisie_logo_2017.svg.png" },
|
||
]; |