import React, { useMemo } from 'react'; // @ts-ignore - Peer dependency import { View, Text, StyleSheet } from 'react-native'; // @ts-ignore - Peer dependency import FastImage from 'react-native-fast-image'; import type { ThumbnailData } from '../../types/timeline'; import { COLORS } from '../../constants/colors'; interface ThumbnailStripProps { thumbnails: ThumbnailData[]; timelineWidth: number; isGenerating?: boolean; } export const ThumbnailStrip: React.FC = ({ thumbnails, timelineWidth, isGenerating, }) => { const containerWidthStyle = useMemo( () => ({ width: timelineWidth }), [timelineWidth] ); const getThumbnailStyle = (thumb: ThumbnailData) => ({ width: thumb.width, opacity: thumb.status === 'failed' ? 0.3 : 1, }); if (isGenerating && thumbnails.length === 0) { return ( Generating thumbnails... ); } if (thumbnails.length === 0) { return ( ); } return ( {thumbnails.map((thumb, index) => ( ))} {/* Loading indicator overlay for progressive loading */} {isGenerating && ( Loading {thumbnails.length} thumbnails... )} ); }; const styles = StyleSheet.create({ container: { height: 60, backgroundColor: COLORS.BACKGROUND_SECONDARY, overflow: 'hidden', }, thumbnailRow: { flexDirection: 'row', height: '100%', }, thumbnail: { height: 60, }, placeholder: { flex: 1, backgroundColor: COLORS.BACKGROUND_SECONDARY, }, loadingOverlay: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', }, loadingText: { color: COLORS.TEXT_SECONDARY, fontSize: 12, }, });