diff --git a/frontend/src/components/WinnerBadge.jsx b/frontend/src/components/WinnerBadge.jsx index 323bf1f..64ac143 100644 --- a/frontend/src/components/WinnerBadge.jsx +++ b/frontend/src/components/WinnerBadge.jsx @@ -1,28 +1,43 @@ -// frontend/src/utils/winnerStorage.js +// src/components/WinnerBadge.jsx +import React from "react"; +import { styles } from "../styles/styles"; +import { stylesTokens } from "../styles/theme"; -function winnerKey(gameId) { - return `winner:${gameId}`; -} +export default function WinnerBadge({ winner }) { + const w = (winner || "").trim(); + if (!w) return null; -export function getWinnerLS(gameId) { - if (!gameId) return ""; - try { - return localStorage.getItem(winnerKey(gameId)) || ""; - } catch { - return ""; - } -} + return ( +