import {
  createNativeStackNavigator,
  NativeStackNavigationProp,
} from '@react-navigation/native-stack';
import {useSelector} from 'react-redux';
import {RootState} from '@redux/store';
import {Box} from '@gluestack-ui/themed/build/components/Box';
import {ThemeMode} from '@configs/colors';
import {Text} from 'react-native';

export const ProfileTabName = 'Profile';

export type ProfileStackNavigatorParamList = {
  Overview: undefined;
};

const ProfileStack =
  createNativeStackNavigator<ProfileStackNavigatorParamList>();

export type ProfileScreenNavigationProp =
  NativeStackNavigationProp<ProfileStackNavigatorParamList>;

function ProfileTab() {
  const lang = useSelector((state: RootState) => state.appVariables.lang);

  return (
    <ProfileStack.Navigator>
      <ProfileStack.Screen
        name="Overview"
        options={{
          animation: 'slide_from_left',
          title: lang.navigation.home.profile,
          headerShown: true,
        }}
        component={ProfileScreen}
      />
    </ProfileStack.Navigator>
  );
}

function ProfileScreen() {
  const theme = useSelector(
    (state: RootState) => state.appVariables.preferences.theme,
  );
  return (
    <>
      <Box
        bg="blackBG.400"
        {...(theme === ThemeMode.Darkest
          ? {borderBottomWidth: 1, borderColor: 'white.900'}
          : {})}
        style={{
          width: '100%',
          paddingVertical: 20,
          borderBottomLeftRadius: 20,
        }}>
        <Text>Test</Text>
      </Box>
    </>
  );
}

export default ProfileTab;
