import React, { FunctionComponent } from 'react'; import { AppNotificationSeverity } from 'app/types'; interface Props { title: string; icon?: string; text?: string; severity: AppNotificationSeverity; onClose?: () => void; } function getIconFromSeverity(severity: AppNotificationSeverity): string { switch (severity) { case AppNotificationSeverity.Error: { return 'fa fa-exclamation-triangle'; } case AppNotificationSeverity.Success: { return 'fa fa-check'; } default: return null; } } export const AlertBox: FunctionComponent = ({ title, icon, text, severity, onClose }) => { return (
{title}
{text &&
{text}
}
{onClose && ( )}
); };