import { useEffect } from 'react';
import { View, StyleSheet, ActivityIndicator } from 'react-native';
import { Tabs, router } from 'expo-router';
import { BlurView } from 'expo-blur';
import Svg, { Path, Circle, Line, Polyline } from 'react-native-svg';
import { Colors, TAB_BAR_HEIGHT } from '../../constants/theme';
import { useAuth, usePlayer, useLikes } from '../../store';
import MiniPlayer from '../../components/MiniPlayer';
import Player from '../../components/Player';
export default function TabsLayout() {
const { user, ready } = useAuth();
const { expanded } = usePlayer();
const { loadLikes } = useLikes();
useEffect(() => {
if (ready && !user) router.replace('/auth');
}, [user, ready]);
useEffect(() => {
if (user) loadLikes();
}, [user]);
if (!ready) return (
);
if (!user) return null;
return (
(
),
tabBarActiveTintColor: Colors.text,
tabBarInactiveTintColor: Colors.text3,
tabBarLabelStyle: { fontSize: 9, fontWeight: '500', letterSpacing: 0.3, marginBottom: 4 },
tabBarItemStyle: { paddingTop: 6 },
}}
>
}} />
}} />
}} />
}} />
}} />
{expanded && }
);
}
function HomeIcon({ color }: { color: string }) {
return (
);
}
function LibIcon({ color }: { color: string }) {
return (
);
}
function SearchIcon({ color }: { color: string }) {
return (
);
}
function HeartIcon({ color }: { color: string }) {
return (
);
}
function ProfileIcon({ color }: { color: string }) {
return (
);
}
const styles = StyleSheet.create({
tabBar: {
position: 'absolute',
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: 'rgba(255,255,255,0.08)',
backgroundColor: 'transparent',
elevation: 0,
height: TAB_BAR_HEIGHT,
},
});