import React, {Component} from 'react';
import {View, Text, StatusBar, SafeAreaView} from 'react-native';
import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions';
import DueDate from './DueDate/DueDate';
import Escrow from './Escrow/Escrow';
import PriceList from './PriceList/PriceList';
import TimeTransaction from './TimeTransaction/TimeTransaction';
import I18n from '../../helper/i18/i18n';
import {connect} from 'react-redux';

import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
const Tab = createMaterialTopTabNavigator();
import HeaderDrawer from '../../components/Header/HeaderDrawer';

const NewFeed = (props) => {
  return (
    <View style={{flex: 1}}>
      <HeaderDrawer title={'Tradding'} isWhite={true} />
      <View style={{flex: 1, backgroundColor: 'white'}}>
        <Tab.Navigator
          initialRouteName="PriceList"
          swipeEnabled={false}
          tabBarOptions={{
            scrollEnabled: true,
            inactiveTintColor: '#929292',
            activeTintColor: '#1473E6',
            labelStyle: {fontSize: getFontXD(36)},
            style: {backgroundColor: 'white'},
          }}>
          <Tab.Screen
            name="PriceList"
            component={PriceList}
            options={{
              tabBarLabel:
                props.language.language == 'vi' ? 'Bảng phí' : 'PriceList',
            }}
          />
          <Tab.Screen
            name="TimeTransaction"
            component={TimeTransaction}
            options={{
              tabBarLabel:
                props.language.language == 'vi'
                  ? 'Thời gian GD'
                  : 'Time transace',
            }}
          />
          <Tab.Screen
            name="Escrow"
            component={Escrow}
            options={{
              tabBarLabel:
                props.language.language == 'vi' ? 'Ký quỹ' : 'Escrow',
            }}
          />
          <Tab.Screen
            name="DueDate"
            component={DueDate}
            options={{
              tabBarLabel:
                props.language.language == 'vi' ? 'Lịch đáo hạn' : 'Due date',
            }}
          />
        </Tab.Navigator>
      </View>
    </View>
  );
};

const mapStateToProps = (state) => {
  return {
    language: state.languageReducer,
  };
};

export default connect(mapStateToProps, {})(NewFeed);
