import React, { useContext, useEffect, useState } from "react"; import { MaterialCommunityIcons } from '@expo/vector-icons'; import { UserContext } from "../context/UserContext"; import { API } from "../environment/api"; import { Box, Button, Center, FormControl, Heading, ScrollView, VStack,FlatList, HStack,Avatar,Spacer,Text } from "native-base"; export default function Invitados({navigation}) { const [isRequesting, setIsRequesting] = useState(false); const [invitados, setInvitados] = useState([]); const id = "62ff074949eb1e993a9d0fda"; useEffect(() => { const onRequestCommentsData = async () => { setIsRequesting(true); try { const jsonResponse = await fetch(`${API.BASE_URL}/guest/findGuestUser/`+`${id}`, { method: "GET", headers: { 'Content-Type': 'application/json' } }) const response = await jsonResponse.json(); console.log(response); setInvitados(response.message); } catch (error) { } setIsRequesting(false) } onRequestCommentsData() }) const data = [{ id: "bd7acbea-c1b1-46c2-aed5-3ad53abb28ba", fullName: "Aafreen Khan", timeStamp: "12:47 PM", recentText: "Good Day!" }, { id: "3ac68afc-c605-48d3-a4f8-fbd91aa97f63", fullName: "Sujitha Mathur", timeStamp: "11:11 PM", recentText: "Cheer up, there!" }, { id: "58694a0f-3da1-471f-bd96-145571e29d72", fullName: "Anci Barroco", timeStamp: "6:22 PM", recentText: "Good Day!" }, { id: "68694a0f-3da1-431f-bd56-142371e29d72", fullName: "Aniket Kumar", timeStamp: "8:56 PM", recentText: "All the best" }, { id: "28694a0f-3da1-471f-bd96-142456e29d72", fullName: "Kiara", timeStamp: "12:47 PM", recentText: "I will call today." }]; return ( Lista de invitados {item.name+" "+item.last_name} {item.dni} {item.phone} {item.number_plate} } keyExtractor={item => item.id} /> ); }