"use client" import { useEffect, useRef } from "react" import Image from "next/image" import Link from "next/link" import { useSearchParams } from "next/navigation" import { ArrowLeft } from "lucide-react" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { robots } from "@/lib/robot-data" export default function RobotsPage() { const searchParams = useSearchParams() const highlightedRobot = searchParams.get("highlight") const robotRefs = useRef<{ [key: string]: HTMLDivElement | null }>({}) // 滚动到高亮的机器人 useEffect(() => { if (highlightedRobot && robotRefs.current[highlightedRobot]) { robotRefs.current[highlightedRobot]?.scrollIntoView({ behavior: "smooth", block: "start", }) } }, [highlightedRobot]) return (

机器人展示

探索 Simba Robotics 为 RoboMaster 竞赛开发的机器人

{/* 机器人列表 */}
{robots.map((robot) => (
{ robotRefs.current[robot.id] = el; }} className={`scroll-mt-24 ${highlightedRobot === robot.id ? "ring-2 ring-primary p-4" : ""}`} >
{robot.name}
{robot.category}

{robot.year}

{robot.name}

{robot.gallery.map((image, idx) => (
{`${robot.name}
))}

{robot.name}

{robot.description}

{robot.specs.map((spec, idx) => (
{spec.icon}

{spec.name}

{spec.value}

))}

主要特点:

    {robot.features.map((feature, idx) => (
  • {feature}
  • ))}

获得荣誉:

    {robot.achievements.map((achievement, idx) => (
  • {achievement}
  • ))}

开发团队:

{robot.team.map((member, idx) => (
{member.name} ({member.role})
))}
))}
) }