"use client";
import { jsx } from 'react/jsx-runtime';
import { ImageZoom } from './image-zoom.mjs';

function ImageGrid({ type = "url", images, altPrefix = '', cdnBaseUrl, }) {
    return (jsx("div", { style: {
            display: 'grid',
            gridTemplateColumns: 'repeat(2, 1fr)',
            gap: '16px',
            justifyItems: 'center',
            alignItems: 'center',
        }, children: images.map((img, idx) => (jsx(ImageZoom, { src: img.startsWith('http://') || img.startsWith('https://') ? img : (type === "url" ? `${cdnBaseUrl === null || cdnBaseUrl === void 0 ? void 0 : cdnBaseUrl.replace(/\/+$/, '')}/${img.replace(/^\/+/, '')}` : img), alt: `${altPrefix}-${idx + 1}` }, img))) }));
}

export { ImageGrid };
