'use client' import Image from 'next/image' import { useState } from 'react' import { ChevronDown, ChevronUp } from 'lucide-react' interface ActivityProps { activity: { title: string coverImage: string description: string date: string participants: string[] organizer: string } } const ActivityCard: React.FC = ({ activity }) => { const [isExpanded, setIsExpanded] = useState(false) return (
{activity.title}

{activity.title}

{activity.description}

日期:{activity.date}

组织者:{activity.organizer}

参与者:

{activity.participants.length <= 3 ? (
    {activity.participants.map((participant, index) => (
  • {participant}
  • ))}
) : (
    {activity.participants.slice(0, 3).map((participant, index) => (
  • {participant}
  • ))}
{isExpanded && (
    {activity.participants.slice(3).map((participant, index) => (
  • {participant}
  • ))}
)}
)}
) } export default ActivityCard