import React, { useState } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import Button from '../../ui/button'; import Checkbox from '../../ui/check-box'; import Tooltip from '../../ui/tooltip'; const HomeNotification = ({ acceptText, checkboxText, checkboxTooltipText, classNames = [], descriptionText, ignoreText, infoText, onAccept, onIgnore, }) => { const [checkboxState, setCheckBoxState] = useState(false); const checkboxElement = checkboxText && ( setCheckBoxState((checked) => !checked)} /> ); return (
{descriptionText}
{infoText ? ( ) : null}
{onAccept && acceptText ? ( ) : null} {onIgnore && ignoreText ? ( ) : null} {checkboxText ? (
{checkboxTooltipText ? ( {checkboxElement} ) : ( checkboxElement )}
) : null}
); }; HomeNotification.propTypes = { acceptText: PropTypes.node, checkboxText: PropTypes.node, checkboxTooltipText: PropTypes.node, classNames: PropTypes.array, descriptionText: PropTypes.node.isRequired, ignoreText: PropTypes.node, infoText: PropTypes.node, onAccept: PropTypes.func, onIgnore: PropTypes.func, }; export default HomeNotification;