import { createPortal } from 'react-dom' import { PREVIEW_WIDTH, type PreviewState } from '../hooks/usePreview' import { formatUsd, printingLabel } from '../lib/price' import { ManaCost, ManaText } from './ManaCost' // Rules-text panel shown on hover, built from the server's own card data // (no external image requests). Rendered into
, not where it's used: // a panel inside the sidebar (the ban list) would otherwise sit in the // sidebar's stacking context, and the deck column would paint over it. export function CardPreview({ state }: { state: PreviewState | null }) { if (!state) return null const { card } = state // Multi-face cards (split, adventure, transform) join each field with " // ". const names = card.name.split(' // ') const types = card.type_line.split(' // ') const costs = card.mana_cost.split(' // ') const texts = card.oracle_text.split(' // ') return createPortal( , document.body, ) }