import { EventFragment } from "@/gql/graphql";
import { EventItem } from "./EventItem";
import styles from "./featuredEvents.module.scss";
import { SectionHeader } from "../general/SectionHeader";

export const FeaturedEvents = ({ events }: { events: EventFragment[] }) => {
  return (
    <section>
      <SectionHeader heading="Arrangementer" link="/arrangementer" linkText="Se alle arrangementer" />
      <ul className={styles.eventList}>
        {events.slice(0, 3).map((event) => (
          <EventItem key={event.id} event={event} mode="list" />
        ))}
      </ul>
    </section>
  );
};
