'use client'; import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'; import { Eye, Shield, Sparkles, Swords, UserRound, X } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogClose, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { cardPresentation, type VisibleCard } from '@/game/card-presentation'; /** Always pass a card from the requesting player's authorized view, never a deck. */ type CardProps = { card: VisibleCard }; export function CardRules({ card }: CardProps) { return (

{cardPresentation(card).guidance}

); } const faceColors = { weapon: 'from-[#512f28] via-[#302622] to-[#171b17]', defense: 'from-[#284544] via-[#243330] to-[#171b17]', leader: 'from-[#4b3c23] via-[#353123] to-[#171b17]', utility: 'from-[#38344b] via-[#2d2c34] to-[#171b17]', }; const roleIcons = { weapon: Swords, defense: Shield, leader: UserRound, utility: Sparkles, }; /** Read-only inspection. It cannot play a card, read game state, or reveal another card. */ export function CardInspector({ card }: CardProps) { const presentation = cardPresentation(card); const Icon = roleIcons[presentation.role]; return ( } aria-label={`Inspect card: ${card.name}`} >
Card inspection } >
{presentation.category}
{card.name} {presentation.guidance}
Treachery · gameplay guide

{presentation.availability ?? 'Inspecting a card does not play it. Close this view to use the table’s action controls.'}

{presentation.gameplay && (

Playing {card.name}

{presentation.gameplay.map((paragraph) => (

{paragraph}

))}
)} {presentation.topics.map((topic, index) => (
{topic.title}
{topic.steps.map((step) => (

{step}

))} {topic.example && (

Example: {topic.example}

)}
))}
); }