import React from "react"; import * as GQL from "src/core/generated-graphql"; import { GalleryCard } from "./GalleryCard"; import { useCardWidth, useContainerDimensions, } from "../Shared/GridCard/GridCard"; interface IGalleryCardGrid { galleries: GQL.SlimGalleryDataFragment[]; selectedIds: Set; zoomIndex: number; onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; } const zoomWidths = [280, 340, 480, 640]; export const GalleryCardGrid: React.FC = ({ galleries, selectedIds, zoomIndex, onSelectChange, }) => { const [componentRef, { width: containerWidth }] = useContainerDimensions(); const cardWidth = useCardWidth(containerWidth, zoomIndex, zoomWidths); return (
{galleries.map((gallery) => ( 0} selected={selectedIds.has(gallery.id)} onSelectedChanged={(selected: boolean, shiftKey: boolean) => onSelectChange(gallery.id, selected, shiftKey) } /> ))}
); };