import { ScrollView, Text, StyleSheet, View } from 'react-native'; import React, { useEffect, useState } from 'react'; import { CardDeUna, DatosCard } from './card'; interface Props { datos?: DatosCard[]; backgroundColor?: string; title?: string; } export function Sectioncard({ datos, title = 'Promociones', }: Props): JSX.Element { const [dataCard, setDataCard] = useState([] as any); useEffect(() => { setDataCard(datos); }, [datos]); return ( {title} {dataCard && dataCard.map((item: any,key:number) => { return ; })} ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'white', width: '100%', marginVertical: 10, }, text1: { fontSize: 20, fontWeight: 'bold', color: 'black', marginHorizontal: 20, marginVertical: 10, }, box: { width: 60, height: 60, marginVertical: 20, }, });