Support Sapho ordering for Great Maker votes
Verify and publish checkpoint container / container (push) Successful in 11m14s
Verify and publish checkpoint container / container (push) Successful in 11m14s
This commit is contained in:
1 parent
e81725e4b2
commit
77d02b3231
18 files changed
+798
-21
No files matched your search
@@ -0,0 +1,35 @@
|
||||
'use client';
|
||||
|
||||
import type { Action } from '@/game/engine';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
/** The opportunity is public; card custody is projected separately to its owner. */
|
||||
export type SaphoGreatMakerPriorityView = {
|
||||
event: string;
|
||||
canPass: boolean;
|
||||
waiting: boolean;
|
||||
};
|
||||
|
||||
export type SaphoGreatMakerPriorityProps = {
|
||||
game: { saphoGreatMakerPriority?: SaphoGreatMakerPriorityView | null };
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
};
|
||||
|
||||
export function SaphoGreatMakerPriority({ game, act, busy }: SaphoGreatMakerPriorityProps) {
|
||||
const view = game.saphoGreatMakerPriority;
|
||||
if (!view) return null;
|
||||
const event = view.event;
|
||||
const canAct = () => !busy && game.saphoGreatMakerPriority === view &&
|
||||
view.event === event && typeof event === 'string' && event.length > 0 && view.canPass;
|
||||
|
||||
return <section className="notice space-y-3" aria-label="Great Maker vote order" aria-live="polite">
|
||||
<h3>Great Maker vote order</h3>
|
||||
<p>Before the next vote, players may use an available order change from their own hand. Votes already cast stay finished.</p>
|
||||
{view.canPass ? <Button className="game-action min-h-11 whitespace-normal"
|
||||
data-testid="sapho-great-maker-priority-pass" disabled={!canAct()}
|
||||
onClick={() => { if (canAct()) act({ type: 'saphoGreatMakerPass', event }); }}>
|
||||
Continue without changing vote order
|
||||
</Button> : <p>{view.waiting ? 'Waiting for the other players to continue.' : 'Your response has been recorded.'}</p>}
|
||||
</section>;
|
||||
}
|
||||
Reference in new issue
Block a user