import { FC } from "react"; import { AddressInputBannerProps } from "./types"; import { Text } from "@shared/components/text"; import { cx } from "@shared/utils"; const variantStyles: Record = { yellow: { bg: "bg-fill-brand-accent", text: "text" }, white: { bg: "white", text: "text" }, navy: { bg: "bg-fill-inverse", text: "text-inverse" }, green: { bg: "bg-fill-success", text: "text-inverse" }, }; export const AddressInputBanner: FC = props => { const { title, variant = "yellow", cta, navHeight, isVisible, renderCheckPlans, } = props; const style = variantStyles[variant?.toLowerCase()] || variantStyles.yellow; if (!isVisible) return null; const ctaLabel = cta?.buttonLabel || "Check plans"; const renderedCheckPlans = renderCheckPlans?.({ ctaText: ctaLabel, buttonVariant: cta?.buttonVariant, showButtonAs: "solid", cta: cta, }); return (
{title} {renderedCheckPlans ?
{renderedCheckPlans}
: null}
); };