import { ExclamationIcon } from "@heroicons/react/outline"; import { XIcon } from "@heroicons/react/solid"; import classNames from "classnames"; import noop from "lodash/noop"; import { ReactNode } from "react"; export type TopBannerProps = { text: string; variant?: keyof typeof variantClassName; actions?: ReactNode; onClose?: () => void; }; const variantClassName = { default: "bg-gradient-primary", warning: "bg-orange-400", error: "bg-red-400", }; export function TopBanner(props: TopBannerProps) { const { variant = "default", text, actions, onClose } = props; return (

{["warning", "error"].includes(variant) && (

{actions &&
{actions}
}
{typeof onClose === "function" && ( )}
); }