'use client' import { useState, useRef, useEffect } from 'react' import { motion } from 'framer-motion' import ActivityCard from '@/components/ActivityCard' import { Input } from "@/components/ui/input" import { useConfig } from './hooks/useConfig' export default function Home() { const { config } = useConfig() const [searchTerm, setSearchTerm] = useState('') const videoRef = useRef(null) const filteredActivities = config.activities.filter(activity => activity.title.toLowerCase().includes(searchTerm.toLowerCase()) || activity.description.toLowerCase().includes(searchTerm.toLowerCase()) || activity.organizer.toLowerCase().includes(searchTerm.toLowerCase()) ) useEffect(() => { if (videoRef.current) { videoRef.current.play().catch(error => { console.error("视频自动播放失败:", error) }) } }, []) return (

欢迎来到影视星河

用镜头捕捉世界的美

社团活动

setSearchTerm(e.target.value)} className="max-w-md mx-auto" />
{filteredActivities.map((activity, index) => ( ))}
) }