import type { CardColor, Hand } from '../types'; export function computePlayable(hand: Hand, ledColor: CardColor | null): Set { const keys = Object.keys(hand); if (!ledColor) return new Set(keys); const ledKeys = keys.filter((k) => hand[k].color === ledColor); if (ledKeys.length > 0) return new Set(ledKeys); const heartKeys = keys.filter((k) => hand[k].color === 'HEARTS'); if (heartKeys.length > 0) return new Set(heartKeys); return new Set(keys); }