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

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="#10a37f" size="large" />
    </View>
  );
}
