typescript on both client and server with communication via socket.io

This commit is contained in:
Gavin McDonald
2025-04-09 11:28:35 -04:00
parent 9f2773f45d
commit 3c4b8cf56e
73 changed files with 1233 additions and 41 deletions

28
components/Card.tsx Normal file
View File

@@ -0,0 +1,28 @@
'use client';
type CardProps = {
id: string;
flipped: boolean;
onFlip: (id: string) => void;
};
export default function Card({ id, flipped, onFlip }: CardProps) {
return (
<div
className={`w-24 h-32 flex items-center justify-center cursor-pointer`}
onClick={() => onFlip(id)}
>
{flipped ? (
<img
src={`/cards/${id}.svg`}
/>
) : (
<img
src="/cards/1B.svg"
/>
)
}
</div>
);
}