import React from 'react'; import {View} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {useTracked} from '../../provider'; import {DDS} from '../../services/DeviceDetection'; import Navigation from '../../services/Navigation'; import {SIZE} from '../../utils/SizeUtils'; import {PressableButton} from '../PressableButton'; import Paragraph from '../Typography/Paragraph'; export const MenuListItem = ({item, index, noTextMode, ignore, testID}) => { const [state, dispatch] = useTracked(); const {currentScreen, colors} = state; const _onPress = (event) => { if (item.func) { item.func(); } else { Navigation.navigate( item.name, { menu: true, }, { heading: item.name, id: item.name.toLowerCase() + '_navigation', }, ); } if (item.close) { Navigation.closeDrawer(); } }; return ( {noTextMode ? null : {item.name}} {item.switch && !noTextMode ? ( ) : undefined} ); };