import { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router"; import { BannerAlert } from "~/ui/components/BannerAlert"; // Subframe migration (strangler shim): // Keeps the original SuccessBanner API but renders the Subframe design-system BannerAlert // (type="success"). BannerAlert has no separate title slot, so the (optional, translated) title // is composed into the content (rendered bold) alongside text/redirect/children. As before, the // title is only shown when provided and is passed through `t()`. `redirect` maps to // BannerAlert's `actionLabel` (the underlined action). interface Props { title?: string; text?: ReactNode | string; redirect?: string; children?: ReactNode; } export default function SuccessBanner({ title, text = "", redirect, children }: Props) { const { t } = useTranslation(); return ( {t("shared.goTo")} {redirect} ) : undefined } > {title && {t(title)} } {text} {children} ); }