mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
Map resize correction + player focus + cleaning
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { env } from 'next-runtime-env';
|
||||
import { useEffect, useState } from "react";
|
||||
import useAdmin from "@/hook/useAdmin";
|
||||
import { GameState } from '@/util/gameState';
|
||||
import { getStatus } from '@/util/functions';
|
||||
|
||||
function DotLine({ label, value }) {
|
||||
return (
|
||||
@@ -27,28 +27,6 @@ function IconValue({ color, icon, value }) {
|
||||
);
|
||||
}
|
||||
|
||||
const TEAM_STATUS = {
|
||||
playing: { label: "En jeu", color: "text-custom-green" },
|
||||
captured: { label: "Capturée", color: "text-custom-red" },
|
||||
outofzone: { label: "Hors zone", color: "text-custom-orange" },
|
||||
ready: { label: "Placée", color: "text-custom-green" },
|
||||
notready: { label: "Non placée", color: "text-custom-red" },
|
||||
waiting: { label: "En attente", color: "text-custom-grey" },
|
||||
};
|
||||
|
||||
function getStatus(team, gamestate) {
|
||||
switch (gamestate) {
|
||||
case GameState.SETUP:
|
||||
return TEAM_STATUS.waiting;
|
||||
case GameState.PLACEMENT:
|
||||
return team.ready ? TEAM_STATUS.ready : TEAM_STATUS.notready;
|
||||
case GameState.PLAYING:
|
||||
return team.captured ? TEAM_STATUS.captured : team.outofzone ? TEAM_STATUS.outofzone : TEAM_STATUS.playing;
|
||||
case GameState.FINISHED:
|
||||
return team.captured ? TEAM_STATUS.captured : TEAM_STATUS.playing;
|
||||
}
|
||||
}
|
||||
|
||||
export default function TeamSidePanel({ selectedTeamId, onClose }) {
|
||||
const { getTeam, startDate, gameState } = useAdmin();
|
||||
const [imgSrc, setImgSrc] = useState("");
|
||||
|
||||
Reference in New Issue
Block a user