import React from 'react';

const EventCard = ({ event, onClick }) => {
    return (
        <div className="card-container" onClick={onClick}>
            <h3>{event.title}</h3>
            <p>Date: {new Date(event.date).toLocaleDateString()}</p>
            <p>Location: {event.location}</p>
            <p>Description: {event.description}</p>
            <p>Organized by: {event.organizer.name}</p> {/* Assuming organizer has a name property */}
            <p>Attendees Count: {event.attendees.length}</p>
            {event.registrationLink && <a href={event.registrationLink}>Register</a>}
        </div>
    );
};

export default EventCard;
