You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Application-Web/front/views/editor/CourtAction.tsx

23 lines
682 B

import { Action } from "../../tactic/Action"
import BendableArrow from "../../components/arrows/BendableArrow"
export interface CourtActionProps {
action: Action
onActionChanges: (a: Action) => void
}
export function CourtAction({ action, onActionChanges }: CourtActionProps) {
return (
<BendableArrow
startPos={action.moveFrom}
segments={action.segments}
onSegmentsChanges={(edges) => {
onActionChanges({ ...action, segments: edges })
}}
//TODO place those magic values in constants
endRadius={action.toPlayerId ? 26 : 17}
startRadius={26}
/>
)
}