/* eslint-disable @next/next/no-img-element */ import { deepClone } from '@/lib/utils' import Link from 'next/link' import { useState } from 'react' /** * 游戏列表- 关联游戏,在详情页展示 * @returns */ export const GameListNormal = ({ games, maxCount = 18 }) => { const gamesClone = deepClone(games) // 构造一个List const components = [] let index = 0 // 无限循环 while (gamesClone?.length > 0 && index < maxCount) { const item = gamesClone.shift() components.push() index++ continue } return (
{components?.map((ItemComponent, index) => { return ItemComponent })}
) } /** * 游戏=单卡 * @param {*} param0 * @returns */ const GameItem = ({ item }) => { const { title } = item const img = item.pageCoverThumbnail const [showType, setShowType] = useState('img') // img or video const video = item?.ext?.video return ( { setShowType('video') }} onMouseOut={() => { setShowType('img') }} title={title} className={`card-single h-28 w-28 relative shadow rounded-md overflow-hidden flex justify-center items-center group hover:border-purple-400`}>
{title}
{showType === 'video' && ( )} {title} ) }