import { XIcon } from "~/components/ui/icons/vendor"; 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 ErrorBanner API but renders the Subframe design-system BannerAlert // (type="error"). BannerAlert has no separate title slot, so the title is composed into the // content (rendered bold) alongside text/redirect/children — same as before, all ReactNode. // `redirect` maps to BannerAlert's `actionLabel` (the underlined action). `onDismiss` is NOT // mapped to BannerAlert's `dismissible` button because that button is a non-functional design // mock (no onClick); the original functional dismiss button is overlaid to preserve behavior. interface Props { title?: ReactNode; text?: ReactNode | string; redirect?: string; children?: ReactNode; onDismiss?: () => void; } export default function ErrorBanner({ title, text = "", redirect, children, onDismiss }: Props) { const { t } = useTranslation(); return (
{t("shared.goTo")} {redirect} ) : undefined } > {title ?? t("shared.error")}{" "} {text} {children} {onDismiss && (
)}
); }