import { useEffect } from "react";
import { View, ActivityIndicator } from "react-native";
import { router } from "expo-router";
import { hasCompletedOnboarding } from "@/lib/setupState";
import { COLORS } from "@/lib/constants";

export default function Index() {
  useEffect(() => {
    hasCompletedOnboarding().then((done) => {
      router.replace(done ? "/(tabs)" : "/onboarding");
    });
  }, []);

  return (
    <View className="flex-1 bg-neutral-950 items-center justify-center">
      <ActivityIndicator color={COLORS.codex} size="large" />
    </View>
  );
}
