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

interface IProps extends IStyledProps<{ icon?: TextStyle, container?: ViewStyle }>, IButtonProps {
    callIconName?: string;
    callIconType?: any;
}

export const EndPbxCallButtonView: FunctionComponent<IProps> = ({
    onPress,
    callIconName,
    callIconType,
    style
}) => {
    style = { ...defaultStyle, ...style };
    const containerStyle = { ...defaultStyle.container, ...style.container }
    callIconName = callIconName || 'call-end';

    return (
        <TouchableOpacity onPress={onPress} style={containerStyle}>
            <Icon
                name={callIconName}
                color='white'
                size={30}
            />
        </TouchableOpacity>
    );
};

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