import { Tabs, Redirect } from 'expo-router'; import { MaterialIcons } from '@expo/vector-icons'; import { StyleSheet } from 'react-native'; import { COLORS } from '../../src/constants'; import { useHouseholdStore } from '../../src/hooks/useHousehold'; export default function TabLayout() { const household = useHouseholdStore((s) => s.household); const isInitialized = useHouseholdStore((s) => s.isInitialized); const shoppingList = useHouseholdStore((s) => s.shoppingList); const unChecked = shoppingList.filter((e) => !e.isChecked).length; if (isInitialized && !household) { return ; } return ( ( ), }} /> ( ), tabBarBadge: unChecked > 0 ? unChecked : undefined, }} /> ( ), }} /> ); } const styles = StyleSheet.create({ tabBar: { backgroundColor: COLORS.white, borderTopColor: COLORS.border, borderTopWidth: StyleSheet.hairlineWidth, elevation: 0, shadowColor: '#000', shadowOpacity: 0.06, shadowRadius: 12, shadowOffset: { width: 0, height: -2 }, }, tabLabel: { fontSize: 11, fontWeight: '600', }, header: { backgroundColor: COLORS.white, }, headerTitle: { fontWeight: '700', fontSize: 17, color: COLORS.text, }, });