"use client"; import { cn } from "@/lib/cn"; import { Card, SUIT_IS_RED, SUIT_SYMBOL, rankLabel } from "@/lib/hokm/types"; const SIZES = { sm: { w: 44, h: 62, rank: "text-base", pip: "text-lg", center: "text-2xl" }, md: { w: 60, h: 84, rank: "text-lg", pip: "text-xl", center: "text-3xl" }, lg: { w: 74, h: 104, rank: "text-xl", pip: "text-2xl", center: "text-4xl" }, } as const; export type CardSize = keyof typeof SIZES; interface Props { card?: Card; faceDown?: boolean; size?: CardSize; className?: string; dimmed?: boolean; } export function PlayingCard({ card, faceDown, size = "md", className, dimmed, }: Props) { const s = SIZES[size]; if (faceDown || !card) { return (
); } const red = SUIT_IS_RED[card.suit]; const color = red ? "text-rose-600" : "text-slate-900"; const symbol = SUIT_SYMBOL[card.suit]; return (
{rankLabel(card.rank)}
{symbol}
{symbol}
{rankLabel(card.rank)}
{symbol}
); }