Skip to content

Commit 6d0214a

Browse files
authored
fix: React Rules of Hooks violation (#368)
2 parents 8b1abc4 + 95b8f4c commit 6d0214a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/Toast/creditsToast.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import { toast } from "sonner";
2-
import { useTranslation } from "react-i18next";
2+
import i18n from "@/i18n";
3+
34
export function showCreditsToast() {
45
toast.dismiss();
5-
const { t } = useTranslation();
66
toast(
77
<div>
8-
{t("chat.you-ve-reached-the-limit-of-your-current-plan")}
8+
{i18n.t("chat.you-ve-reached-the-limit-of-your-current-plan")}
99
<a
1010
className="underline cursor-pointer"
1111
onClick={() => (window.location.href = "https://www.eigent.ai/pricing")}
1212
>
13-
{t("chat.upgrade")}
13+
{i18n.t("chat.upgrade")}
1414
</a>{" "}
15-
{t("chat.your-account-or-switch-to-a-self-hosted-model-and-api-in")}{" "}
15+
{i18n.t("chat.your-account-or-switch-to-a-self-hosted-model-and-api-in")}{" "}
1616
<a
1717
className="underline cursor-pointer"
1818
onClick={() => (window.location.href = "#/setting/general")}
1919
>
20-
{t("chat.settings")}
20+
{i18n.t("chat.settings")}
2121
</a>{" "}
2222
.
2323
</div>,

0 commit comments

Comments
 (0)