import { Event } from "@/common/parser";
import { EventCard } from "./EventCard";

export function EventList({
    events,
    title,
    showDate,
    showLine,
}: {
    events: Event[];
    title?: string;
    showDate?: boolean;
    showLine?: boolean;
}) {
    return (
        <div className="space-y-2 w-full">
            {title && <h2 className="text-2xl font-bold">{title}</h2>}
            {events.length === 0 && (
                <p className="text-gray-500">Žádné události.</p>
            )}
            {events.map((event) => (
                <EventCard
                    key={event.id}
                    event={event}
                    showDate={showDate}
                    showLine={showLine}
                />
            ))}
        </div>
    );
}