import React, { type Ref } from 'react' import { cn } from '../../services/cn' import Button from '../Button/Button' import { type ButtonProps } from '../Button/Button.models' import Icon from '../Icons/Icon' export type BannerProps = { /** Primary text to display */ primaryText: string /** Secondary text to display */ secondaryText: string /** Type of Banner */ type: 'informational' | 'issue' /** Class to be applied to the component */ className?: string /** Optional Button to be used in the Banner. It appears on the right side of the Banner. */ buttonProps?: ButtonProps /** Optionally hide the info Icon */ hideInfoIcon?: boolean /** Optionally show a close button. This function is called when the close button is clicked. */ closeButtonCallout?: () => void /** Optional prop to add a test id to the Banner for QA testing */ qaTestId?: string } const bannerVariants = { informational: 'bg-dark-blue', issue: 'bg-dark-red', } as const const Banner = ({ primaryText, secondaryText, className = '', type = 'informational', hideInfoIcon, closeButtonCallout, buttonProps, ref, qaTestId = 'banner', }: BannerProps & { ref?: Ref }): React.JSX.Element => { return ( // Banner container with full viewport width minus padding