import { useEffect, useState } from 'react'; import { v4 } from 'uuid'; import cardTierToKey from '../../util/mechanics/cardTierToKey'; import { CardRowProps } from '../../util/propTypes'; import { CardData } from "../../util/types" import Card from "../Card/Card" import "./CardRow.scss"; export default function CardRow({tier, state, setState, liftCollapsed}: CardRowProps) { const [collapsed, setCollapsed] = useState(true); const typedTier = cardTierToKey(tier); let cards: Array switch (tier) { case 1: cards = state.gameboard.cardRows.tierOne; break; case 2: cards = state.gameboard.cardRows.tierTwo; break; case 3: cards = state.gameboard.cardRows.tierThree; break; default: cards = new Array; break; } useEffect(() => { liftCollapsed(collapsed, tier); }, [collapsed]) return (

Tier: {tier}

Remaining: {state.gameboard.deck[typedTier].length}

{ cards && cards.map((cardData: CardData) => { return })}
) }