import React from 'react';
import {
  SafeAreaView,
  View,
  Text,
  Linking,
  StyleSheet,
  Dimensions,
  Image,
  Platform,
} from 'react-native';
//Screen
import {IMAGES} from '../../values/images';
//Values
import string from '../../values/string';
import Alert from 'react-native-awesome-alerts';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
function NoConnection({isShow}) {
  const onOpenSetting = () => {
    Platform.OS === 'ios'
      ? Linking.openURL('App-Prefs:Wifi')
      : // Linking.openSettings('app-settings:');
        Linking.sendIntent('android.settings.SETTINGS');
  };

  return (
    <SafeAreaView style={styles.container}>
      <Alert
        show={isShow}
        showProgress={false}
        title={'Hệ thống'}
        message={'Vui lòng đổi wifi hoặc sử dụng 4G'}
        closeOnTouchOutside={false}
        closeOnHardwareBackPress={false}
        showConfirmButton={true}
        confirmText="Open setting"
        confirmButtonColor="#DD6B55"
        onConfirmPressed={onOpenSetting}
      />
    </SafeAreaView>
  );
}
const styles = StyleSheet.create({
  container: {},
  mainView: {
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'white',
  },
  textWrapper: {
    justifyContent: 'center',
    alignItems: 'center',
    flexDirection: 'row',
  },
  text: {
    textAlign: 'center',
    marginLeft: 50,
    marginRight: 50,
    color: 'black',
  },
  emptyView: {flex: 2, backgroundColor: 'white'},
});
export default NoConnection;
