'use client'; import Link from 'next/link'; import { Video } from '@/lib/types'; import Image from 'next/image'; import React from 'react'; import { Card } from '@/components/ui/Card'; import { Icons } from '@/components/ui/Icon'; interface PremiumContentGridProps { videos: Video[]; loading: boolean; hasMore: boolean; onVideoClick?: (video: Video) => void; prefetchRef: React.RefObject; loadMoreRef: React.RefObject; } export function PremiumContentGrid({ videos, loading, hasMore, onVideoClick, prefetchRef, loadMoreRef, }: PremiumContentGridProps) { if (videos.length === 0 && !loading) { return ; } return ( <>
{videos.map((video) => ( ) => { // Allow default behavior for modifier keys (new tab, etc.) if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return; e.preventDefault(); onVideoClick?.(video); }} className="group cursor-pointer hover:translate-y-[-2px] transition-transform duration-200 ease-out" style={{ position: 'relative', zIndex: 1, contentVisibility: 'auto' }} onMouseEnter={(e: React.MouseEvent) => (e.currentTarget.style.zIndex = '100')} onMouseLeave={(e: React.MouseEvent) => (e.currentTarget.style.zIndex = '1')} >
{video.vod_pic ? ( {video.vod_name} ) : (
无封面
)} {video.vod_remarks && (
{video.vod_remarks}
)}

{video.vod_name}

{video.type_name && (

{video.type_name}

)}
))}
{/* Prefetch Trigger - Earlier */} {hasMore && !loading &&
} {/* Loading Indicator */} {loading && } {/* Intersection Observer Target */} {hasMore && !loading &&
} {/* No More Content */} {!hasMore && videos.length > 0 && } ); } function PremiumGridLoading() { return (

加载中...

); } function PremiumGridNoMore() { return (

没有更多内容了

); } function PremiumGridEmpty() { return (

暂无内容

); }