import { Redirect } from "expo-router";
import { useAuthStore } from "../src/store";
import { View, ActivityIndicator, StyleSheet } from "react-native";
export default function Index() {
const { isAuthenticated, isLoading, user } = useAuthStore();
// Show loading state while auth is being determined
if (isLoading) {
return (
);
}
// Redirect based on auth state
if (!isAuthenticated) {
return ;
}
// If user hasn't completed onboarding, go to onboarding first
if (!user?.onboarding_completed) {
return ;
}
// Go to home/dashboard - users can pair from within the app
// No forced redirect to pairing for users without a couple
return ;
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#1a1a2e",
},
});