import { useContext } from 'react';
import { DefaultTheme, NavigationContainer } from '@react-navigation/native';
import { Box } from '@gluestack-ui/themed';

import { AuthRoutes } from './auth.routes';
import { AppRoutes } from './app.routes';

import { gluestackUIConfig } from '../../config/gluestack-ui.config';
import { useAuth } from '@hooks/useAuth';

export function Routes() {
  const theme = DefaultTheme;
  const { user } = useAuth();
  console.debug(user);

  theme.colors.background = gluestackUIConfig.tokens.colors.gray700;

  return (
    <Box flex={1} bg="$gray700">
      <NavigationContainer theme={theme}>
        <AuthRoutes />
      </NavigationContainer>
    </Box>
  );
}
