Bridge ReactPlay
PlayEditor
Value/onChange-driven play editor with interactive card selection.
Import from @workspace/bridge-react/play/editors/play-editor.
Overview
PlayEditor is a self-contained play editor with dual rendering modes. In edit mode it uses PlayInputs for interactive card selection; in read-only mode it renders TricksDisplay.
import { PlayEditor } from '@workspace/bridge-react/play/editors/play-editor';
<PlayEditor
hands={hands}
tricks={tricks}
declarer="S"
auctionSequence={auction.sequence}
onTricksChange={setTricks}
comments={comments}
onCommentsChange={setComments}
/>Dual Mode
| Mode | Condition | Renders |
|---|---|---|
| Edit | readOnly is falsy | PlayInputs — interactive card selection grid |
| Read-only | readOnly={true} | TricksDisplay — static trick table |
// Read-only mode
<PlayEditor
hands={hands}
tricks={tricks}
auctionSequence={auctionSequence}
readOnly
/>Lead Player Derivation
The opening lead player is derived automatically from the declarer prop — it's the player to the left of declarer. If no declarer is provided, defaults to West.
Comments
Play comments can be managed externally via comments/onCommentsChange, or the editor manages them internally if those props are omitted.
Props
Prop
Type
Notes
- Wrapped with
withBridgeContext— can be used outside aBridgeProvider auctionSequenceis passed toPlayInputsfor trump suit derivation