Files
Dune/components/battle-component-inspection.tsx
T
2026-09-08 07:37:52 +10:00

41 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import { CardInspector } from './card-inspector';
import {
LeaderInspector,
type LeaderDisplayIdentity,
} from './leader-inspector';
import type { VisibleCard } from '@/game/card-presentation';
/** The parent supplies only faces already authorized by its private game view. */
export function BattleComponentInspection({
cards,
leader,
playerName,
}: {
cards: readonly VisibleCard[];
leader?: LeaderDisplayIdentity;
playerName: string;
}) {
if (!cards.length && !leader) return null;
return (
<details className="battle-component-inspection">
<summary>Inspect {playerName}’s plan components</summary>
<div className="visible-component-list">
{leader && (
<div>
<strong>{leader.name}</strong>
<LeaderInspector identity={leader} />
</div>
)}
{cards.map((card) => (
<div key={card.id}>
<strong>{card.name}</strong>
<CardInspector card={card} />
</div>
))}
</div>
</details>
);
}