import { Card as Card_Type, Rank } from '../game/types' import { Card } from './Card' import { use_is_mobile } from '../hooks/use_is_mobile' interface Table_Props { cards: Card_Type[] level: Rank combo_type: string last_play_seat?: number | null } export function Table({ cards, level, combo_type, last_play_seat }: Table_Props) { const is_mobile = use_is_mobile() const card_width = is_mobile ? 56 : 70 const overlap = is_mobile ? 32 : 40 const show_highlight = last_play_seat !== null && last_play_seat !== undefined && cards.length > 0 return (
0 ? card_width + (cards.length - 1) * overlap : 100, height: is_mobile ? 80 : 100, justifyContent: 'center', }} > {cards.length > 0 ? ( cards.map((card, index) => (
{}} size={is_mobile ? 'small' : 'normal'} />
)) ) : (
No cards played
)}
{combo_type && (
{combo_type}
)}
) }