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

const ProfileView = (props) => {
  return (
    <KeyboardAvoidingView
      behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
      style={{flex: 1}}
      keyboardVerticalOffset={-50}>
      <ScrollView style={{flex: 1}} showsVerticalScrollIndicator={false}>
        <View style={{flex: 1}}>
          <HeaderBack isWhite={true} title={'Thông tin cá nhân'} />
          <View>
            <Tab.Navigator
              initialRouteName="GeneralInfor"
              tabBarOptions={{
                inactiveTintColor: '#929292',
                activeTintColor: '#1473E6',
                labelStyle: {fontSize: getFontXD(36)},
                style: {backgroundColor: 'white'},
              }}>
              <Tab.Screen
                name="GeneralInfor"
                component={GeneralInfor}
                options={{tabBarLabel: 'Thông tin chung'}}
              />
              <Tab.Screen
                name="CQG"
                component={CQG}
                options={{tabBarLabel: 'Tài khoản CQG'}}
              />
            </Tab.Navigator>
          </View>
        </View>
      </ScrollView>
    </KeyboardAvoidingView>
  );
};

export default ProfileView;
