import {useRef} from "react"; import "../../style/player.css"; import RemoveIcon from "../../assets/icon/remove.svg?react"; import Draggable from "react-draggable"; import {PlayerPiece} from "./PlayerPiece"; import {Player} from "../../tactic/Player"; export interface PlayerProps { player: Player, onChange: (p: Player) => void, onRemove: () => void } /** * A player that is placed on the court, which can be selected, and moved in the associated bounds * */ export default function CourtPlayer({player, onChange, onRemove}: PlayerProps) { const x = player.rightRatio const y = player.bottomRatio return ( onChange({ id: player.id, rightRatio: player.rightRatio, bottomRatio: player.bottomRatio, team: player.team, role: player.role })} >
{ if (e.key == "Delete") onRemove() }}>
) }