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