import { IconCheckCircle, IconInfo, IconWarning } from '../Icon'; import React from 'react'; export interface IAlert { className?: string; children?: React.ReactNode; dismissible?: boolean; show?: boolean; style?: React.CSSProperties; variant?: | 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' onClose?(): void; [x: string]: any; } export const Alert: React.FC = (props) => { const { children, className = '', dismissible, style, show = true, variant = 'warning', onClose, ...otherProps } = props; function handleClose() { onClose && onClose(); } return (
{ variant == "success" && } { variant == "danger" && } { variant == "warning" && } { variant == "info" && } {children} {dismissible && ( )}
); };