mirror of
https://github.com/lexogrine/cs2-react-hud.git
synced 2025-12-10 03:52:48 +01:00
31 lines
739 B
TypeScript
31 lines
739 B
TypeScript
import { Map, PhaseRaw } from "csgogsi";
|
|
|
|
interface IProps {
|
|
phase: PhaseRaw | null;
|
|
map: Map;
|
|
}
|
|
|
|
const Timeout = ({ phase, map }: IProps) => {
|
|
const time = phase && Math.abs(Math.ceil(parseFloat(phase.phase_ends_in)));
|
|
const team = phase && phase.phase === "timeout_t" ? map.team_t : map.team_ct;
|
|
|
|
return (
|
|
<div
|
|
id={`timeout`}
|
|
className={`${
|
|
time && time > 2 && phase &&
|
|
(phase.phase === "timeout_t" || phase.phase === "timeout_ct")
|
|
? "show"
|
|
: ""
|
|
} ${
|
|
phase && (phase.phase === "timeout_t" || phase.phase === "timeout_ct")
|
|
? phase.phase.substring(8)
|
|
: ""
|
|
}`}
|
|
>
|
|
{team.name} TIMEOUT
|
|
</div>
|
|
);
|
|
};
|
|
export default Timeout;
|