import { VenueFragment } from "@/gql/graphql";
import styles from "./venueItem.module.scss";
import Link from "next/link";
import Image from "../general/Image";

export const VenueItem = ({ venue }: { venue: VenueFragment }) => {
  return (
    <li className={`${styles.venueItem} linkItem`}>
      <div className={styles.image}>
        {venue.featuredImage && (
          <Image
            src={venue.featuredImage.url}
            alt={venue.featuredImage.alt}
            width={0}
            height={0}
            sizes="20vw"
          />
        )}
      </div>
      <div className={styles.text}>
        <h1 className={styles.title}>{venue.title}</h1>
        <p className={styles.details}>Detaljer om lokalet</p>
      </div>
      <Link href={`/lokaler/${venue.slug}`} className="hiddenLink">
        Mer om lokalet {venue.title}
      </Link>
    </li>
  );
};
