import React from "react"; import { ScrollView, View, ViewStyle, ActivityIndicator, ScrollViewProps, } from "react-native"; interface HorizontalScrollProps extends ScrollViewProps { data?: T[] | null; renderItem: (item: T, index: number) => React.ReactNode; containerStyle?: ViewStyle; contentContainerStyle?: ViewStyle; loadingContainerStyle?: ViewStyle; } export function HorizontalScroll({ data, renderItem, containerStyle, contentContainerStyle, loadingContainerStyle, ...props }: HorizontalScrollProps): React.ReactElement { if (!data) { return ( ); } return ( {data.map((item, index) => ( {renderItem(item, index)} ))} ); }