import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
export default function ActionableMessage ({
shown = true,
message = '',
actions = [],
className = '',
}) {
return (
shown
? (
{message}
{
actions.map(({ label, onClick, actionClassName }, index) => (
{label}
))
}
)
: null
)
}
ActionableMessage.propTypes = {
shown: PropTypes.bool,
message: PropTypes.string.isRequired,
actions: PropTypes.shape({
label: PropTypes.string,
onClick: PropTypes.func,
actionClassName: PropTypes.string,
}),
className: PropTypes.string,
}