@smitch/fluid
Version:
A Next/React ui-component libray.
12 lines (11 loc) • 763 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, style = _a.style;
return (_jsx("div", { className: twMerge("gallery group min-w-full grid grid-cols-2 gap-2 md:gap-4 md:grid-cols-3 lg:grid-cols-6", 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 }, index)); }) }));
};
export default Gallery;