@smitch/fluid
Version:
A lightweight, Tailwind-powered React/Next.js UI component library.
12 lines • 897 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { twMerge } from "tailwind-merge";
import { Figure } from "..";
var getCaption = function (name, caption) {
return caption ? name : "";
};
var Gallery = function (_a) {
var _b = _a.className, className = _b === void 0 ? "" : _b, aspect = _a.aspect, data = _a.data, _c = _a.caption, caption = _c === void 0 ? true : _c, _d = _a.preloadImages, preloadImages = _d === void 0 ? false : _d, style = _a.style;
return (_jsx("div", { className: twMerge("gallery group min-w-full grid grid-cols-2 gap-2 md:grid-cols-3 lg:grid-cols-6 bg-slate-800 p-2", className), style: style, children: data.map(function (item, index) { return (_jsx(Figure, { src: item.src, alt: item.name, caption: getCaption(item.name, caption), aspect: aspect, preload: preloadImages }, index)); }) }));
};
export default Gallery;
//# sourceMappingURL=Gallery.js.map