import React, { FC, useContext } from 'react'; import { SectionList, SectionListProps, View } from 'react-native'; import Item from './Item'; import { GridContext } from './index'; import styles from './styles'; import { SpanNumber } from './types'; export interface ItemSectionListProps extends SectionListProps { /** * Represents the width of the Card component in terms of span numbers (1-12). */ widthSpan?: SpanNumber; } const ItemSectionList: FC = ({ renderItem, widthSpan, style, contentContainerStyle, ...props }) => { const { gutterSize, numberOfColumns } = useContext(GridContext); const widthItem = (widthSpan ?? numberOfColumns) as SpanNumber; const _renderItem = (item: any) => { return {renderItem?.(item)}; }; return ( } style={[style, styles.protectedStyle]} contentContainerStyle={[contentContainerStyle, styles.protectedStyle]} /> ); }; export default ItemSectionList;