import {Redirect, Stack} from 'expo-router';
import {StyleSheet, Text, TextInput, TouchableOpacity} from 'react-native';

import {ThemedText} from '@/components/ThemedText';
import {ThemedView} from '@/components/ThemedView';
import {useToken} from '@/context/AppProvider';
import {Colors} from '@/constants/Colors';
import React, {useEffect} from 'react';
import {useColorScheme} from '@/hooks/useColorScheme';
import {Message} from '@/services/message';
import {Request} from '@/services/request';
import { router } from 'expo-router';

export default function OnboardStartScreen() {
  const {token, isLoading} = useToken();

  // You can keep the splash screen open, or render a loading screen like we do here.
  if (isLoading) {
    return (
      <ThemedView>
        <ThemedText>Laden...</ThemedText>
      </ThemedView>
    );
  }

  if (!token) {
    return <Redirect href="/(onboarding)/start"/>;
  }

  return <Redirect href="/(tabs)"/>;
}
