"use client" import { useState } from "react" import Link from "next/link" import Image from "next/image" import { motion } from "motion/react" import { Gamepad2Icon, TrendingUpIcon, DatabaseIcon, ArrowRightIcon, MonitorIcon, CheckCircleIcon, } from "lucide-react" import { getDeviceColor } from "@/components/charts/EChartWrapper" export interface DeviceStats { slug: string name: string deviceType: string image: string | null sortOrder: number colorIndex: number totalBenchmarks: number avgFps: number | null gameCount: number verifiedCount: number bestGame: { id: string title: string headerImage: string | null fpsAvg: number } | null } const deviceTypeLabel: Record = { handheld: "Handheld", console: "Console", } const deviceTypeColor: Record = { handheld: "text-primary bg-primary/10 border-primary/20", console: "text-secondary bg-secondary/10 border-secondary/20", } type FilterType = "all" | "handheld" | "console" const filterOptions: { id: FilterType; label: string }[] = [ { id: "all", label: "All" }, { id: "handheld", label: "Handheld" }, { id: "console", label: "Console" }, ] export function DevicesPageClient({ devices }: { devices: DeviceStats[] }) { const [activeFilter, setActiveFilter] = useState("all") const filteredDevices = activeFilter === "all" ? devices : devices.filter((d) => d.deviceType === activeFilter) if (devices.length === 0) { return (

No devices found

Benchmark data will appear as devices are added

) } return (
{/* Hero Header */}

Devices

Browse benchmark data for handheld and console devices

{/* Filter Tabs */}
{filterOptions.map((opt) => ( ))}
{/* Device Grid */}
{filteredDevices.map((device, i) => ( {/* Image / Icon Header */}
{device.image ? ( {device.name} ) : ( )}
{/* Card Body */}
{/* Name & Type */}

{device.name}

{deviceTypeLabel[device.deviceType] || device.deviceType}
{/* Stats Row */}
{device.totalBenchmarks} Benchmarks
{device.avgFps !== null ? device.avgFps : "—"} Avg FPS
{device.gameCount} Games
{device.verifiedCount} Verified
{/* Best game */} {device.bestGame && (
Top:{" "} {device.bestGame.title} {" "} · {device.bestGame.fpsAvg} FPS
)}
))}
{filteredDevices.length === 0 && devices.length > 0 && (

No {activeFilter} devices found

)}
) }