mirror of
https://github.com/DerTyp7/apartment-altenau-nextjs.git
synced 2025-10-29 12:52:12 +01:00
36 lines
921 B
JavaScript
36 lines
921 B
JavaScript
/* eslint-disable @next/next/no-img-element */
|
|
import { useEffect, useState } from "react";
|
|
import styles from "../styles/GalleryGrid.module.scss";
|
|
import { useRouter } from "next/router";
|
|
|
|
function GalleryGrid({ images, baseURL }) {
|
|
const router = useRouter();
|
|
const locale = router.locale;
|
|
|
|
return (
|
|
<div className={styles.galleryGrid}>
|
|
<div className={styles.galleryGridGrid}>
|
|
{images.length > 0
|
|
? images.map((image, i) => (
|
|
<div
|
|
key={i}
|
|
onClick={() => router.push({ search: "activeImg=" + image.id })}
|
|
className="noSelect"
|
|
>
|
|
<img
|
|
src={image.url}
|
|
alt={locale === "en" ? image.title.en : image.title.de}
|
|
/>
|
|
<div className={styles.galleryImageTitle}>
|
|
<p>{locale === "en" ? image.title.en : image.title.de}</p>
|
|
</div>
|
|
</div>
|
|
))
|
|
: ""}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default GalleryGrid;
|