import { createContext, useState } from "react"
import AwesomeAlert from 'react-native-awesome-alerts';
import * as Animatable from 'react-native-animatable';
import { ActivityIndicator } from 'react-native';
export const AppContext = createContext()
export const AppContextProvider = ({ children }) => {
const [isLoading, setIsLoading] = useState(false);
const [alert, setAlert] = useState({
text: '',
type: null,
show: false,
title: '',
cancelButton: false,
confirmButton: true,
cargando: false
})
const aliveAlert = () => {
return (
<View style={styles.container}>
<View style={styles.loadingContainer}>
{isLoading && (
<Animatable.View animation="bounce" style={styles.loadingContainer}>
<ActivityIndicator size="large" color="#ffffff" />
<Text style={styles.loadingText}> {strings.TransferenciaEnCurso}</Text>
</Animatable.View>
)}
</View>
</View>
)
}
return <AppContext.Provider value={{aliveAlert, setIsLoading,isLoading }}>
{children}
</AppContext.Provider>
}