import React from "react"; import { Timer } from "../MatchBar/MatchBar"; import { Player } from "csgogsi"; import * as I from "./../../assets/Icons"; interface IProps { timer: Timer | null; side: "right" | "left" } export default class Bomb extends React.Component { 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
; } render() { const { side, timer } = this.props; return (
{ timer ?
{this.getCaption(timer.type, timer.player)}
: null }
); } }