import * as React from "react"; import { FunctionComponent } from "react"; import { getColorByBrightness } from "@mancala/core"; import { useTranslation } from "react-i18next"; import { Context } from "../../context/context"; import Button from "../Button"; // Shown during a live game while an earlier position is on the board. const ReviewBanner: FunctionComponent<{ context: Context, moveNumber: number, isYourTurn: boolean, onBackToLive: () => void, }> = ({ context, moveNumber, isYourTurn, onBackToLive }) => { const { t } = useTranslation(); const theme = context.themeManager.theme; const background = isYourTurn ? theme.playerTurnColor : theme.boardColor; const textColor = getColorByBrightness(background, theme.textColor, theme.textLightColor); return (
{`⟲ ${t("ViewingMove", { number: moveNumber })}`} {isYourTurn && {` · ${t("YourTurn")}`}}
); }; export default ReviewBanner;