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 "../../data/Player"; export interface PlayerProps { player: Player, 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, onRemove}: PlayerProps) { const ref = useRef(null); const x = player.rightRatio; const y = player.bottomRatio; return (
{ if (e.key == "Delete") onRemove() }}>
) }