import React from 'react';
import PropTypes from 'prop-types';

import { TouchableOpacity } from 'react-native';
import { Icon } from 'react-native-elements';

export default function EventsIcon({ action }) {
    const renderEventsIcon = () => <Icon name="calendar" type="evilicon" size={28} />;

    if (action) {
        return <TouchableOpacity onPress={action}>{renderEventsIcon()}</TouchableOpacity>;
    }

    return renderEventsIcon();
}

EventsIcon.propTypes = {
    action: PropTypes.func,
};

EventsIcon.defaultProps = {
    action: null,
};
