--- // @ts-ignore - types provided by Astro at runtime import Image from "./Image.astro"; interface ImageItem { /** Source image imported via astro:assets */ src: any; /** Alt text for accessibility */ alt: string; /** Individual caption for this image */ caption?: string; /** Optional individual image ID for referencing */ id?: string; /** Enable zoom on this specific image (defaults to parent zoomable setting) */ zoomable?: boolean; /** Enable download on this specific image (defaults to parent downloadable setting) */ downloadable?: boolean; } interface Props { /** Array of images to display */ images: ImageItem[]; /** Global caption for the entire figure */ caption?: string; /** Layout mode: number of columns or 'auto' for responsive */ layout?: "2-column" | "3-column" | "4-column" | "auto"; /** Enable medium-zoom behavior on all images (can be overridden per image) */ zoomable?: boolean; /** Show download buttons on all images (can be overridden per image) */ downloadable?: boolean; /** Optional class to apply on the wrapper */ class?: string; /** Optional global ID for the multi-image figure */ id?: string; } const { images, caption, layout = "3-column", zoomable = false, downloadable = false, class: className, id, } = Astro.props as Props; const hasCaptionSlot = Astro.slots.has("caption"); const hasCaption = hasCaptionSlot || (typeof caption === "string" && caption.length > 0); const uid = `mi_${Math.random().toString(36).slice(2)}`; // Generate CSS grid columns based on layout const getGridColumns = () => { switch (layout) { case "2-column": return "repeat(2, 1fr)"; case "3-column": return "repeat(3, 1fr)"; case "4-column": return "repeat(4, 1fr)"; case "auto": return "repeat(auto-fit, minmax(200px, 1fr))"; default: return "repeat(3, 1fr)"; } }; const gridColumns = getGridColumns(); ---