import React, { FunctionComponent } from 'react';
import { StyleSheet, TouchableOpacity, ViewStyle } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { IButtonProps, IStyledProps } from '../../../../common/types';

interface IProps extends IStyledProps<{ image?: any, container?: ViewStyle }>, IButtonProps { }

export const AnswerCallButtonView: FunctionComponent<IProps> = ({
    onPress,
    style
}) => {
    style = { ...defaultStyle, ...style };
    const containerStyle = { ...defaultStyle.container, ...style.container }
    const iconStyle = { ...defaultStyle.image, ...style.image }
    return (
        <TouchableOpacity onPress={onPress} style={containerStyle}>
            <Icon
                name="call"
                size={40}
                color="white"
                style={iconStyle}
            />
        </TouchableOpacity>
    );
};

const defaultStyle = StyleSheet.create({
    container: {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        width: 60,
        height: 60,
        borderRadius: 30,
        borderColor: 'white',
        backgroundColor: 'green'
    },
    image: {
        opacity: 1,
    },
});
