UNPKG

@etsoo/website

Version:

ETSOO CMS Based NextJs Website Framework

16 lines (15 loc) 1.18 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /** * Common photos renderer * @param props Props */ export function CommonPhotosRenderer(props) { // Destruct const { photos, noContent } = props; if (photos == null || photos.length < 1) return; return (_jsx("div", { className: `container et-gallery${noContent ? '' : ' mt-4'}`, children: _jsx("div", { className: "row", "data-masonry": '{"percentPosition": true }', children: photos.map((photo, index) => { var _a; return (_jsxs("div", { className: "col-sm-12 col-md-4 col-xxl-3 mb-3", children: [_jsx("a", { className: "lightbox", href: photo.url, title: photo.title, "data-caption": photo.description, "data-bs-toggle": "tooltip", children: _jsx("img", { alt: photo.title || `Photo ${index}`, src: photo.url, width: photo.width, height: photo.height, className: "img-fluid" }) }, photo.url), photo.title && (_jsx("div", { className: "et-gallery-link", children: _jsx("a", { href: (_a = photo.link) !== null && _a !== void 0 ? _a : '#', referrerPolicy: "no-referrer", target: "_blank", children: photo.title }) }))] }, photo.url)); }) }) })); }