import { Tabs } from "expo-router/js-tabs";
import { Redirect, router } from "expo-router";
import React, { useEffect } from "react";
import { View, ActivityIndicator } from "react-native";
import { HapticTab } from "@/components/misc/haptic-tab";
import { IconSymbol } from "@/components/ui/icon-symbol";
import { Colors } from "@/constants/theme";
import { useColorScheme } from "@/hooks/use-color-scheme";
import { useAuth } from "@/context/AuthContext";
export default function TabLayout() {
const colorScheme = useColorScheme();
const { isAuthenticated, isLoading } = useAuth();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.replace("/auth/login");
}
}, [isAuthenticated, isLoading]);
if (isLoading) {
return (
);
}
if (!isAuthenticated) {
return ;
}
return (
(
),
}}
/>
(
),
}}
/>
(
),
}}
/>
(
),
}}
/>
(
),
}}
/>
);
}