import * as React from "react"; import { FunctionComponent } from "react"; import { getColorByBrightness, getPlayerDisplayName, LiveGameSummary } from "@mancala/core"; import { useTranslation } from "react-i18next"; import { Context } from "../../context/context"; import Button from "../Button"; // Shown at the top of the home page while the user has a game in progress. const ActiveGameBanner: FunctionComponent<{ context: Context, game: LiveGameSummary, userId: string, onContinue: () => void, }> = ({ context, game, userId, onContinue }) => { const { t } = useTranslation(); const theme = context.themeManager.theme; const textColor = getColorByBrightness(theme.boardColor, theme.textColor, theme.textLightColor); const opponent = game.player1.userId === userId ? game.player2 : game.player1; const turn = game.turnPlayerId === userId ? t("YourTurn") : t("OpponentTurn"); return (