import React, { FunctionComponent } from 'react'; import { takeCall } from '../../../../../store/webrtc/webrtcSlice'; import { ImageSourcePropType } from 'react-native'; import { IP2PCall } from '../../../../../store/webrtc/types'; import { IImageButtonStyleProps, IStyledProps } from '../../../../common/types'; import { AnswerVideoCallButtonView } from './AnswerVideoCallButtonView'; import { ImageButton } from '../../../../common/ImageButton'; import { useAppDispatch } from '../../../../../store/hooks'; export interface IAnswerVideoBtnProps extends IStyledProps { call: IP2PCall imageSource?: ImageSourcePropType; renderOnPress?: (call: IP2PCall) => void; } export const AnswerVideoCallButton: FunctionComponent = ({ imageSource, call, renderOnPress, style }) => { const dispatch = useAppDispatch(); const AnswerVideoCall = () => { if (renderOnPress) { renderOnPress(call); } else { dispatch(takeCall(true)); } }; if (imageSource) { return } else { return ; } };