import React from 'react'; import { NotificationManager } from 'react-notifications'; import { Col, Row } from 'reactstrap'; import Widget from '../../../Widget'; import { Button } from '../../../../../Components/Button'; import { NotificationContext, NotificationContextType } from '../../../../../Components/NotificationContext'; type NotificationType = 'info' | 'success' | 'warning' | 'error'; const Notifications: React.FC = () => { const context = React.useContext(NotificationContext); const createNotification = (type: NotificationType) => { switch (type) { case 'info': NotificationManager.info('Info message'); break; case 'success': NotificationManager.success('Success message', 'Title here'); break; case 'warning': NotificationManager.warning('Warning message', 'Close after 3000ms', 3000); break; case 'error': NotificationManager.error('Error message', 'Click me!', 5000, () => { alert('callback'); }); break; } }; return (
); }; export default Notifications;