import React from 'react'; import {StyleSheet} from 'react-native'; import {Button} from 'react-native-elements'; import {ScreenType} from '../../types'; import {TAGG_LIGHT_BLUE} from '../../constants'; import {handleFriendUnfriend, SCREEN_WIDTH} from '../../utils'; import {NO_PROFILE, NO_USER} from '../../store/initialStates'; import {useDispatch, useSelector, useStore} from 'react-redux'; import {RootState} from 'src/store/rootReducer'; interface ProfileBodyProps { userXId: string | undefined; screenType: ScreenType; } const FriendsButton: React.FC = ({userXId, screenType}) => { const dispatch = useDispatch(); const {user = NO_USER, profile = NO_PROFILE} = userXId ? useSelector((state: RootState) => state.userX[screenType][userXId]) : useSelector((state: RootState) => state.user); const {user: loggedInUser = NO_USER} = useSelector( (state: RootState) => state.user, ); const state = useStore().getState(); const {friendship_status} = profile; return ( <> {friendship_status === 'no_record' && (