2026-10-16 00:31:43 +03:00
|
|
|
import * as React from "react";
|
|
|
|
|
import { FunctionComponent } from "react";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
|
|
|
|
|
|
// Shown during a live game while an earlier position is on the board.
|
|
|
|
|
const ReviewBanner: FunctionComponent<{
|
|
|
|
|
moveNumber: number,
|
|
|
|
|
isYourTurn: boolean,
|
|
|
|
|
onBackToLive: () => void,
|
2026-10-16 09:41:47 +03:00
|
|
|
}> = ({ moveNumber, isYourTurn, onBackToLive }) => {
|
2026-10-16 00:31:43 +03:00
|
|
|
const { t } = useTranslation();
|
|
|
|
|
return (
|
2026-10-16 09:41:47 +03:00
|
|
|
<div className="review" role="status">
|
2026-10-16 00:31:43 +03:00
|
|
|
<span>
|
2026-10-16 09:41:47 +03:00
|
|
|
{t("ViewingMove", { number: moveNumber })}
|
2026-10-16 00:31:43 +03:00
|
|
|
{isYourTurn && <strong>{` · ${t("YourTurn")}`}</strong>}
|
|
|
|
|
</span>
|
2026-10-16 09:41:47 +03:00
|
|
|
<button className="btn pri" onClick={onBackToLive}>{t("BackToLive")}</button>
|
2026-10-16 00:31:43 +03:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ReviewBanner;
|