import Body from "@/components/TempDesignSystem/Text/Body" import Link from "../Link" import AlertSidepeek from "./Sidepeek" import { getIconByAlertType } from "./utils" import { alertVariants } from "./variants" import styles from "./alert.module.css" import type { AlertProps } from "./alert" export default function Alert({ className, variant, type, heading, text, link, phoneContact, sidepeekCtaText, sidepeekContent, }: AlertProps) { const classNames = alertVariants({ className, variant, type, }) const Icon = getIconByAlertType(type) if (!text && !heading) { return null } return (
{heading ? (

{heading}

) : null} {text ? ( {text} {phoneContact?.phoneNumber ? ( <> {phoneContact.displayText} {phoneContact.phoneNumber} {phoneContact.footnote ? ( . ({phoneContact.footnote}) ) : null} ) : null} ) : null}
{link ? ( {link.title} ) : null} {!link && sidepeekCtaText && sidepeekContent ? ( ) : null}
) }