import React from 'react';
import { StyleSheet } from 'react-native';
import {
  Provider as PaperProvider,
  Card,
  Title,
  Paragraph,
} from 'react-native-paper';
export interface DatosCard {
  titulo?: string;
  descripcion?: string;
  imagen?: string;
}
export interface Props {
  datos?: DatosCard;
  backgroundColor?: string;
}
export function CardDeUna({
  datos = {
    titulo: 'hola',
    descripcion: 'hola',
    imagen: 'https://picsum.photos/700',
  },
  backgroundColor = 'white',
}: Props) {
  return (
    <PaperProvider>
      <Card
        onPress={() => console.log('Pressed')}
        style={{ ...style.card, backgroundColor: backgroundColor }}
      >
        <Card.Cover source={{ uri: datos?.imagen }} />
        <Card.Content>
          <Title>{datos?.titulo}</Title>
          <Paragraph>{datos?.descripcion}</Paragraph>
        </Card.Content>
      </Card>
    </PaperProvider>
  );
}
const style = StyleSheet.create({
  card: {
    marginTop: 10,
    margin: 20,
  },
});
