import { format } from "date-fns"; import { Box, ScrollView, Text, Stack, Heading, Badge } from "native-base"; import PropTypes from 'prop-types'; import { MaterialCommunityIcons } from '@expo/vector-icons'; import React from 'react'; export const ReservasCard = ({id, date, startTime, name}) => { const dateFormated = date.toString().split("T")[0] const deleteReservas = async(id) => { try { await fetch(`http://localhost:4000/reservation/deleteReservation/`+`${id}`, { cache: 'no-cache', method: 'DELETE', headers: { 'Content-Type': 'application/json' } }) .then(response => { if (response.status != 201){ console.log('ocurrio un error '); }else{ return response.json(); } }) } catch (error) { console.log("ERROR: " + error); } } return ( {name} {dateFormated} Hora de inicio: {startTime} {/* {deleteReservas(id)}} /> */} ) } ReservasCard.propTypes = { date: PropTypes.string.isRequired, startTime: PropTypes.string.isRequired, id: PropTypes.string.isRequired }