import React from 'react'; import {View, StyleSheet, ScrollView} from 'react-native'; import {ProfilePreviewType, ScreenType} from '../../types'; import {ProfilePreview} from '..'; import {Button} from 'react-native-elements'; import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; import {TAGG_LIGHT_BLUE} from '../../constants'; import {RootState} from '../../store/rootReducer'; import {useDispatch, useStore} from 'react-redux'; import {handleUnfriend} from '../../utils/friends'; import {NO_USER} from '../../store/initialStates'; interface FriendsProps { result: Array; screenType: ScreenType; userId: string; } const Friends: React.FC = ({result, screenType, userId}) => { const state: RootState = useStore().getState(); const dispatch = useDispatch(); const {user: loggedInUser = NO_USER} = state; return ( {result.map((profilePreview) => ( {loggedInUser.userId === userId && (