import { Timer } from "../MatchBar/MatchBar"; import { Player } from "csgogsi"; import * as I from "./../../assets/Icons"; import { MAX_TIMER } from "./Countdown"; interface IProps { timer: Timer | null; side: "right" | "left" } const getCaption = (type: "defusing" | "planting", player: Player | null) => { if(!player) return null; if(type === "defusing"){ return <>
{player.name} is defusing the bomb
; } return <>
{player.name} is planting the bomb
; } const Bomb = ({ timer, side }: IProps) =>{ if(!timer) return null; return (
{ timer ?
{getCaption(timer.type, timer.player)}
: null }
); } export default Bomb;