import { Pressable } from '@bacons/react-views' import { Link } from 'expo-router' import { PressableStateCallbackType, TextStyle } from 'react-native' import { useIsTabSelected } from '../hooks' import { TabbedNavigator } from '../tab-slot' export function TabBarItemWrapper({ children, id, name, onPress, params, style, testID, }: { children?: ( props: PressableStateCallbackType & { hovered: boolean; focused: boolean } ) => JSX.Element id: string name: string onPress?: () => void params?: Record style?: TextStyle testID?: string }) { const focused = useIsTabSelected(id) if (onPress) { return ( {(props) => children?.({ ...props, focused })} ) } if (name.startsWith('/') || name.startsWith('.')) { return ( {(props) => children?.({ ...props, focused })} ) } return ( {(props) => children?.({ ...props, focused })} ) }