import { useEffect, useRef } from 'react' import clsx from 'clsx' import type { Photo } from '../../types/photo' import { photos as photosApi } from '../../services/api' interface PreviewFilmstripProps { photos: Photo[] currentIndex: number onSelect: (id: string) => void } const CELL_SIZE = 72 export function PreviewFilmstrip({ photos, currentIndex, onSelect }: PreviewFilmstripProps) { const activeRef = useRef(null) useEffect(() => { activeRef.current?.scrollIntoView({ block: 'nearest', inline: 'center', behavior: 'smooth', }) }, [currentIndex]) return (
{photos.map((photo, index) => { const isActive = index === currentIndex return ( ) })}
) }