/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import React from "react"; import { SportsMatchRow } from "./SportsMatchRow"; // Alpha-channel WebM mascots (full-widget-frame, fox pre-composited) with a // static first-frame poster so kit is in place before playback starts. const CHAMPION_MASCOT = "chrome://newtab/content/data/content/assets/kit-champion.webm"; const CHAMPION_MASCOT_POSTER = "chrome://newtab/content/data/content/assets/kit-champion.png"; const DEFAULT_MASCOT = "chrome://newtab/content/data/content/assets/kit-default.webm"; const DEFAULT_MASCOT_POSTER = "chrome://newtab/content/data/content/assets/kit-default.png"; const SINGLE_PLACEMENT_LABELS = { champion: { large: "newtab-sports-widget-world-cup-champions", medium: "newtab-sports-widget-world-cup-champions-short", }, runnerUp: { large: "newtab-sports-widget-runner-up", medium: "newtab-sports-widget-runner-up", }, third: { large: "newtab-sports-widget-third-place", medium: "newtab-sports-widget-third-place", }, }; const PODIUM_LABELS = { champion: "newtab-sports-widget-champions", runnerUp: "newtab-sports-widget-runner-up", third: "newtab-sports-widget-third-place", }; const ResultTeam = ({ team, teamName, labelL10nId, variant }) => (
{teamName} {teamName}
); const displayName = (team, localizedNames) => localizedNames?.[team.key] ?? team.name; export const SportsResultCard = ({ team, type = "champion", size = "large", finalMatch = null, finalMatchVariant = "upcoming", tbdTeamName = "", localizedNames = null, }) => { const labels = SINGLE_PLACEMENT_LABELS[type] ?? SINGLE_PLACEMENT_LABELS.champion; return (
{finalMatch ? (

) : null}
); }; export const SportsPodium = ({ placements, localizedNames = null }) => (
); export const SportsResultMascot = ({ animationId = 0, view }) => { const isChampion = view === "champion"; const src = isChampion ? CHAMPION_MASCOT : DEFAULT_MASCOT; const poster = isChampion ? CHAMPION_MASCOT_POSTER : DEFAULT_MASCOT_POSTER; // Remount per celebration (key) so playback restarts from the first frame. return (