import React, {useState, useEffect} from 'react';
import Container from '../components/container';
import {useRoute} from '@react-navigation/native';
import {globalStyles, customStyles, GetPageTheme} from '../styles/Global';
import { StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,} from 'react-native';
import {ReactReduxContext,connect,useSelector,useDispatch,} from 'react-redux';
import {mapStateToProps, mapDispatchToProps} from '../reducers/contextProvider';
import SQLite from 'react-native-sqlite-2';
import {notify} from '../components/notify';
import moment from 'moment';
import {getDownloadJson,DownloadData} from '../controller/functions';
import {get_item, set_item, clear_item} from '../components/localStorage';
import {version,sloganline,appname,testurl,db,} from '../constants/constants';
import CustomHeader from '../components/customHeader';
import CustomLoader from '../components/CustomLoader';
import LinearGradient from 'react-native-linear-gradient';
import { FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons';
import NoDataComponent from '../components/NoDataComponent';

function PersonalDocument(props) {
  const route = useRoute();

  // get all theme styles acc to current theme set
  const PageTheme = GetPageTheme(props.DarkMode, route.name);
  const customStyle = customStyles(props.DarkMode, route.name);
  const globalStyle = globalStyles(props.DarkMode, route.name);
  
  
  const [processing, setProcessing] = useState(false);

  useEffect(() => {
   
  }, []);

  
 
  return (
    <Container {...props} pt={0} avoidSafeArea={(Platform.OS=='ios'?true:false)}>
      {processing && <CustomLoader title="loading..."/>}
      <CustomHeader {...props} showaddstore={true} title={'Personal Documents'}/>
      <LinearGradient colors={[PageTheme.$gradient1,PageTheme.$primary_color]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} style={customStyle.roundScrollWrapper}>
        <View style={customStyle.pageContentWrapper}>
        { !props.isDataDownloaded && <NoDataComponent {...props} />}
        { props.isDataDownloaded==true && 
        <ScrollView
            contentContainerStyle={customStyle.attmenu_listcon}
        >
            
        </ScrollView>
        }
        
        </View>      
      </LinearGradient>      
    </Container>
  );
}

export default connect(mapStateToProps, mapDispatchToProps)(PersonalDocument);
