import React, {useState} from 'react';
import {
  View,
  Text,
  KeyboardAvoidingView,
  ScrollView,
  Platform,
} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack';
import BankInfor from './Tab/BankInfor';
import GeneralInfor from './Tab/GeneralInfor';
import Profile from './Tab/Profile';
import GeneralView from './TabView/GeneralView';
import ProfileView from './TabView/ProfileView';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
import {getFontXD} from '../../Config/Functions';
const Tab = createMaterialTopTabNavigator();
import {connect} from 'react-redux';

import I18n from '../../helper/i18/i18n';

const AccountVerificationView = (props) => {
  return (
    <View style={{flex: 1}}>
      <HeaderBack isWhite={true} title={'AccountVerify'} />
      <Tab.Navigator
        initialRouteName="GeneralInfor"
        tabBarOptions={{
          inactiveTintColor: '#929292',
          activeTintColor: '#1473E6',
          labelStyle: {fontSize: getFontXD(36)},
          style: {backgroundColor: 'white'},
        }}>
        <Tab.Screen
          name="GeneralInfor"
          component={
            props.user.status == 1 || props.user.status == 4
              ? GeneralInfor
              : GeneralView
          }
          options={{tabBarLabel: I18n.t('GeneralInformation')}}
        />
        <Tab.Screen
          name="Profile"
          component={
            props.user.status == 1 || props.user.status == 4
              ? Profile
              : ProfileView
          }
          options={{tabBarLabel: I18n.t('Profile')}}
        />
      </Tab.Navigator>
    </View>
  );
};

const mapStateToProps = (state) => {
  return {
    user: state.userReducer,
  };
};
export default connect(mapStateToProps, {})(AccountVerificationView);
