'use client'; import type { ReactNode } from 'react'; import Image from 'next/image'; import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'; import { Button } from './ui/button'; import { Dialog, DialogClose, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from './ui/dialog'; import type { Action } from '@/game/engine'; import { STRONGHOLD_CARDS, type StrongholdId, type StrongholdState, } from '@/game/stronghold-cards'; type StrongholdDefinition = (typeof STRONGHOLD_CARDS)[number]; /** Original, bundled artwork; rules remain independent selectable text. */ function StrongholdIllustration({ id }: { id: StrongholdId }) { return ( ); } function StrongholdFace({ card, ownership, children, enlarged = false, }: { enlarged?: boolean; card: StrongholdDefinition; ownership?: string; children?: ReactNode; }) { return (

{card.name}

{ownership && (

{ownership}

)} {card.gameplay.map((paragraph) => (

{paragraph}

))} {!enlarged && ( } > Inspect {card.name}
{card.name} } > Close
Full Stronghold Card with its public ownership and gameplay text.
)} {children}

CHOAM & Richese · Advanced Stronghold

); } export function StrongholdCardGallery({ state, players, }: { state: StrongholdState; players: { id: string; name: string }[]; }) { return (

Advanced Stronghold cards

CHOAM & Richese · Optional module {state.claimedTurn > 0 ? ` · Last claim: turn ${state.claimedTurn}` : ' · Initial claims pending'}

{STRONGHOLD_CARDS.map((card) => { const owner = state.owners[card.id]; const name = players.find((player) => player.id === owner)?.name; return ( ); })}
); } export function StrongholdCopyChoice({ event, choices, act, busy, }: { event: string; choices: StrongholdId[]; act: (action: Action) => void; busy: boolean; }) { const available = STRONGHOLD_CARDS.filter((card) => choices.includes(card.id), ); return (

Choose the controlled stronghold advantage to copy before making battle plans.

{available.map((card) => ( ))}
); }