UNPKG

tmemory

Version:

A terminal-based Memory card game built with React Ink. Features multiple grid sizes, AI opponent, and high scores.

24 lines (23 loc) 787 B
import { Box, Text } from 'ink'; import React from 'react'; import { COLORS } from "../../../constants/colors.js"; export const WinnerDisplay = ({ winner }) => { const color = winner === 'Player' || winner === 'P1' ? COLORS.p1 : winner === 'P2' ? COLORS.p2 : winner === 'AI' ? COLORS.ai : COLORS.warn; const message = winner === 'Player' ? 'You Win!' : winner === 'P1' ? 'P1 Wins!' : winner === 'P2' ? 'P2 Wins!' : winner === 'AI' ? 'AI Wins!' : "It's a Tie!"; return (React.createElement(Box, { marginTop: 1 }, React.createElement(Text, { bold: true, color: color }, message))); };