import { useNavigation } from '@react-navigation/native';
import React from 'react';
import {Linking, Text, Modal, AsyncStorage, ActivityIndicator, FlatList, Image, TextInput, TouchableOpacity, View, Dimensions, Alert } from 'react-native';
import SwipeableRow from '../SwipeableRow';
import api from '../../services/api';
import url from '../../services/url';
import { styles } from './styles';
import fonts from "../../styles/fonts";
import { MaterialIcons, EvilIcons, Ionicons } from '@expo/vector-icons';
import { useState } from 'react';
import { showMessage, hideMessage } from "react-native-flash-message";

interface DadosProps {
    data: {
        id: string;
        nome: string;
        senha: string;
        email: string;        
        foto: string;
        cargo: string;
        cpf: string;
       
    }
}


const CardClientes = ({ data }: DadosProps) => {
    const navigation: any = useNavigation();
    const [abrirModal, setAbrirModal] = useState(false);

        
    return (
        <>
            {data.id === undefined || data.nome === undefined ?
              
              <Text style={{ color: '#595858', fontSize: 14, marginTop:10, alignContent:"center", textAlign:"center" }}>Nenhum Registro Encontrado!</Text>
                                             
                :

                <View>                  
                        <TouchableOpacity
                            style={styles.box}
                            onPress={() => setAbrirModal(true)}
                        >
                           <View style={{flex:1, flexDirection:'row', justifyContent:'space-between', marginTop:-5}}>
                                                          
                              <View style={{width:65}}>
                              <Image style={{width:50, height:50, }} source={{uri:(url +'sistema/img/membros/'+ data.foto)}} />
                              </View>                            
                                    <View style={{width:'100%', marginTop:3}}>
                                         <Text style={{ color: '#000', fontSize:15, fontFamily: fonts.text }}>{data.nome} - Nível: {data.cargo}</Text>
                                         <Text style={{ fontSize:13, color: '#000' }}>{data.email} ({data.senha})</Text>
                                         </View>
                                     
                            
                             </View>
                           
                        </TouchableOpacity>
                    
                </View>
            }



        </>
    );
}

export default CardClientes;