"use strict"; import cn from "classnames"; import React from "react"; import closeIcon from "!!svg-sprite-loader!@cloudbees/honeyui-icons/svg/close.svg"; import { Icon } from "../"; import Link from "./link"; import Header from "./header"; type AlertVariants = | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "dark" | "light"; interface IAlertProps { className?: string; dismissible?: boolean; variant?: AlertVariants; style?: object; "data-testid"?: string; onClose?: () => void; } interface IAlertStatic { Link: typeof Link; Header: typeof Header; } const Alert: React.FC & IAlertStatic = props => { const { className, dismissible, variant, children, style, "data-testid": testId, onClose, ...restProps } = props; return (
{dismissible && ( )} {children}
); }; Alert.displayName = "Alert"; Alert.defaultProps = { variant: "primary", "data-testid": "honeyui-alert" }; Alert.Link = Link; Alert.Header = Header; export default Alert;