import React, { FC } from 'react'; import classNames from 'classnames'; import css from './index.module.css'; import { getModifier } from '../../helpers/getModifier'; export interface NotificationProps { message: string; isOpen?: boolean; type?: 'error' | 'info' | 'success' | 'warning'; handleClose?: () => void; } const Notification: FC = ({ message, isOpen, type = 'info', handleClose, }) => { const notificationClassNames = classNames(css.notification, { [`${css[`notification${getModifier(type)}`]}`]: type, }); if (!isOpen) { return null; } return (
{message}
); }; export default Notification;