"use client" import { Button } from "../Button" import { MaterialIcon } from "../Icons/MaterialIcon" import Link from "../OldDSLink" import { Typography } from "../Typography" import AlertSidepeek from "./Sidepeek" import { IconByAlertType } from "./utils" import { alertVariants } from "./variants" import styles from "./alert.module.css" import type { AlertProps } from "./alert" export function Alert({ className, variant, type, heading, text, link, close, phoneContact, sidepeekCtaText, sidepeekContent, ariaLive, ariaRole, }: AlertProps) { const classNames = alertVariants({ className, variant, type, }) if (!text && !heading) { return null } return (
{heading ? (

{heading}

) : null} {text ? (

{text} {phoneContact?.phoneNumber ? ( <> {phoneContact.displayText} {phoneContact.phoneNumber} {phoneContact.footnote ? ( <> {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} . ({phoneContact.footnote}) ) : null} ) : null}

) : null}
{link ? ( {link.title} ) : null} {!link && sidepeekCtaText && sidepeekContent ? ( ) : null}
{close ? ( ) : null}
) }