import { XIcon } from "@heroicons/react/solid"; import classNames from "classnames"; import { noop } from "lodash"; import type { ReactNode } from "react"; import { FiAlertTriangle, FiInfo } from "../icon"; 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 (
{variant === "error" && (
{actions && )} {variant === "warning" && ( )} {text}