'use client'; import ToolTip from '@/components/ToolTip'; import tarokkaCards from '@/constants/tarokkaCards'; import getCardInfo from '@/tools/getCardInfo'; import { Layout, Settings, TarokkaGameCard } from '@/types'; const cardBack = tarokkaCards.find((card) => card.back)!; type CardProps = { dm: boolean; card: TarokkaGameCard; position: Layout; settings: Settings; flipAction: () => void; }; export default function Card({ dm, card, position, settings, flipAction }: CardProps) { const { aria, flipped, url } = card; const handleClick = () => { if (dm) { flipAction(); } }; const getTooltip = () => { const text = getCardInfo(card, position, dm, settings); return text.length ? ( <> {text.map((t, i) => (

{t}

{i < text.length - 1 &&
}
))} ) : null; }; return (
Card Back
{aria}
); }