/** * This file is part of the SplendidBear Websites' projects. * * Copyright (c) 2026 @ www.splendidbear.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import { useMemo } from 'react'; import { StatRow } from './StatRow'; import { object } from 'prop-types'; export const BonusPoints = ({ game }) => { const hasBonuspoints = useMemo( () => 0 < game?.redBonusPoints || 0 < game?.blueBonusPoints || game?.redBonusStats?.blindHits || game?.blueBonusStats?.blindHits, [ game?.blueBonusPoints, game?.blueBonusStats?.blindHits, game?.redBonusPoints, game?.redBonusStats?.blindHits, ], ); const hasRedNoBonuses = useMemo( () => !game.redBonusStats?.blindHits && !game.redBonusStats?.chainBest && !game.redBonusStats?.edgeMines && !game.redBonusStats?.lastMineHits && !game.redBonusStats?.biggestReveal, [ game.redBonusStats?.biggestReveal, game.redBonusStats?.blindHits, game.redBonusStats?.chainBest, game.redBonusStats?.edgeMines, game.redBonusStats?.lastMineHits, ], ); const hasBlueNoBonuses = useMemo( () => !game.blueBonusStats?.blindHits && !game.blueBonusStats?.chainBest && !game.blueBonusStats?.edgeMines && !game.blueBonusStats?.lastMineHits && !game.blueBonusStats?.biggestReveal, [ game.blueBonusStats?.biggestReveal, game.blueBonusStats?.blindHits, game.blueBonusStats?.chainBest, game.blueBonusStats?.edgeMines, game.blueBonusStats?.lastMineHits, ], ); if (!hasBonuspoints) return ''; return (