import React from 'react'
import PropTypes from 'prop-types'
import Alert from 'react-uikit/alert'

const InfoTemplate = ({
    body,
    header,
    iconName,
    isShowing,
    title,
    onDismiss,
}) => {
    return (
        <Alert
            body={body}
            header={header}
            iconName={iconName}
            isShowing={isShowing}
            title={title}
            onDismiss={onDismiss}
        >
            {Boolean(iconName) && <Alert.Icon />}
            {Boolean(header) && <Alert.Header />}
            {Boolean(body) && <Alert.Body />}
        </Alert>
    )
}

InfoTemplate.propTypes = {
    body: PropTypes.string,
    header: PropTypes.string,
    iconName: PropTypes.string,
    isShowing: PropTypes.bool,
    title: PropTypes.string,
    onDismiss: PropTypes.func,
}

export default InfoTemplate
