Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,40 @@
|
||||
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 (
|
||||
<BannerAlert
|
||||
className="not-prose"
|
||||
type="success"
|
||||
fillContainer
|
||||
actionLabel={
|
||||
redirect ? (
|
||||
<Link to={redirect}>
|
||||
{t("shared.goTo")} {redirect}
|
||||
</Link>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
{title && <span className="font-medium">{t(title)} </span>}
|
||||
{text}
|
||||
{children}
|
||||
</BannerAlert>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user