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})
            }}
            endRadius={26}
            startRadius={26}
        />
    )
}
