"use client"; import { EntityGameListRep } from "@/api/home"; import { Button, Modal, ModalBody, ModalContent, useDisclosure } from "@nextui-org/react"; import { useTranslations } from "next-intl"; import { FC, PropsWithChildren, ReactNode } from "react"; import styles from "./style.module.scss"; export interface CardProps { item?: EntityGameListRep; render?: (value: EntityGameListRep) => ReactNode; } const Card: FC> = (props) => { const { render, item } = props; const { isOpen, onOpen, onOpenChange } = useDisclosure(); const app: HTMLElement = document.querySelector("#app")!; const t = useTranslations("Game"); const handler = (game: EntityGameListRep) => { onOpen(); }; return ( <>
handler(item!)}> {render ? ( render(item!) ) : ( {item?.game_name_cn} )}
{(onClose) => ( <>
{item?.game_name_cn}

{item?.game_name_cn}

)}
); }; export default Card;