import React from 'react';
import Styled from 'styled-components/native';
import Icon from './Icon';

const Container = Styled.TouchableOpacity`
    padding: 0px;
    align-items: center;
    justify-content: center;
`;

const IconButton = ({ 
    iconFamily = 'Ionicons', iconName, color = '#000000', size = 30, 
    shadowColor = '', shadowOffset={}, shadowOpacity=0, shadowRadius=0, 
    style={}, iconStyle={}, onPress 
}) => {
    return (
        <Container style={style} shadowColor={shadowColor} shadowOffset={shadowOffset} shadowOpacity={shadowOpacity} shadowRadius={shadowRadius} onPress={() => {
            if(onPress && typeof onPress === 'function') {
                onPress();
            }
        }}>
            <Icon iconFamily={iconFamily} iconName={iconName} color={color} size={size} style={iconStyle} />
        </Container>
    );
};

export default IconButton;
