import React from "react";
import { Text, TouchableOpacity, View, ScrollView } from "react-native";
import { customStyles, GetPageTheme } from "../styles/Global";
import { useRoute } from '@react-navigation/native';

const HeaderTabsTeam = (props) => {
    const route = useRoute();
    const PageTheme = GetPageTheme(props.DarkTheme, route.name);
    const customStyle = customStyles(props.DarkMode, route.name);

    const ST = props.StaticText || {};
    const isAdhocScreen = props.isAdhocScreen;
    const isBeatPlan = props.isBeatPlan;
    const isDBPOSMScreen = props.isDBPOSMScreen;
    const isNPNDScreen = props.isNPNDScreen;
    const isAddStoreScreen = props.isAddStoreScreen;
    const isNonMerchan = props.isNonMerchans;
    const isNonProgs = props.isNonProgs;



    return (
        <View style={customStyle.storeTab_Con}>
            <ScrollView style={customStyle.storeTab_MenuCon} contentContainerStyle={customStyle.storeTab_Menu} horizontal={true}>
                <TouchableOpacity disabled={(!isAdhocScreen && !isNPNDScreen && !isBeatPlan && !isDBPOSMScreen && !isAddStoreScreen && !isNonMerchan && !isNonProgs) ? true : false} style={[customStyle.storeTab_pill, ((!isAdhocScreen && !isNPNDScreen && !isBeatPlan && !isDBPOSMScreen && !isAddStoreScreen && !isNonMerchan && !isNonProgs) ? customStyle.storeTab_pillActive : {})]} onPress={() => { props.navigation.pop(); props.navigation.push('TeamList') }}>
                    <Text style={[customStyle.storeTab_pillText, ((!isAdhocScreen && !isNPNDScreen && !isBeatPlan && !isDBPOSMScreen && !isAddStoreScreen && !isNonMerchan && !isNonProgs) ? customStyle.storeTab_pillActiveText : { color: PageTheme.$text_color })]}>{ST.Planned}</Text>
                </TouchableOpacity>
                <TouchableOpacity disabled={isAdhocScreen ? true : false} style={[customStyle.storeTab_pill, (isAdhocScreen ? customStyle.storeTab_pillActive : {})]} onPress={() => { props.navigation.pop(); props.navigation.push('TeamList', { 'isAdhoc': true }) }}>
                    <Text style={[customStyle.storeTab_pillText, (isAdhocScreen ? customStyle.storeTab_pillActiveText : { color: PageTheme.$text_color })]}>{ST.Adhoc}</Text>
                </TouchableOpacity>
                {/* {props.ShowBeatPlanList==true && 
            <TouchableOpacity style={[customStyle.storeTab_pill,(isBeatPlan?customStyle.storeTab_pillActive:{})]} onPress={()=>{props.navigation.pop();props.navigation.push('StoreList',{'isAdhoc': false,'isBeat':true})}}>
                <Text style={[customStyle.storeTab_pillText,(isBeatPlan?customStyle.storeTab_pillActiveText:{color:PageTheme.$text_color})]}>{'Beat Plan'}</Text>
            </TouchableOpacity>
            }
            {props.ShowStoreAdd==true && 
            <TouchableOpacity style={[customStyle.storeTab_pill,(isAddStoreScreen?customStyle.storeTab_pillActive:{})]} onPress={()=>{props.navigation.navigate('AddStoreScreen',{})}}>
                <Text style={[customStyle.storeTab_pillText,(isAddStoreScreen?customStyle.storeTab_pillActiveText:{color:PageTheme.$text_color})]}>{'Add Store'}</Text>
            </TouchableOpacity>
            }
            {props.ShowNonMerList==true && 
            <TouchableOpacity style={[customStyle.storeTab_pill,(isNonMerchan?customStyle.storeTab_pillActive:{})]} onPress={()=>{props.navigation.pop();props.navigation.push('StoreList',{'isAdhoc': false,'isBeat':false,'isNonMerchans':true,'isNonProgs':false})}}>
                <Text style={[customStyle.storeTab_pillText,(isNonMerchan?customStyle.storeTab_pillActiveText:{color:PageTheme.$text_color})]}>{'Non Merch.'}</Text>
            </TouchableOpacity>
            }
            {props.ShowNonProgram==true && 
            <TouchableOpacity style={[customStyle.storeTab_pill,(isNonProgs?customStyle.storeTab_pillActive:{})]} onPress={()=>{props.navigation.pop();props.navigation.push('StoreList',{'isAdhoc': false,'isBeat':false,'isNonMerchans':false, 'isNonProgs':true})}}>
                <Text style={[customStyle.storeTab_pillText,(isNonProgs?customStyle.storeTab_pillActiveText:{color:PageTheme.$text_color})]}>{props.NonProgramLabel}</Text>
            </TouchableOpacity>
            } */}

                {props.ShowDBPOSM == true &&
                    <TouchableOpacity style={[customStyle.storeTab_pill, (isDBPOSMScreen ? customStyle.storeTab_pillActive : {})]} onPress={() => { props.navigation.navigate('DistributorList', {}) }}>
                        <Text style={[customStyle.storeTab_pillText, (isDBPOSMScreen ? customStyle.storeTab_pillActiveText : { color: PageTheme.$text_color })]}>{'Distributors'}</Text>
                    </TouchableOpacity>
                }

                {props.ShowNPND == true &&
                    <TouchableOpacity style={[customStyle.storeTab_pill, (isNPNDScreen ? customStyle.storeTab_pillActive : {})]} onPress={() => { props.navigation.navigate('NPNDStoreList', {}) }}>
                        <Text style={[customStyle.storeTab_pillText, (isNPNDScreen ? customStyle.storeTab_pillActiveText : { color: PageTheme.$text_color })]}>{props.ShowNPNDLabel}</Text>
                    </TouchableOpacity>
                }



            </ScrollView>
        </View>
    );
};
export default HeaderTabsTeam;