Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2023-06-12 10:14:11 +02:00
parent d4d7518c40
commit 532dddcb2b
3 changed files with 10 additions and 14 deletions

View File

@@ -16,8 +16,7 @@ limitations under the License.
import classNames from "classnames";
import React, { HTMLAttributes, ReactNode } from "react";
import { logger } from "@sentry/utils";
import { Trans } from "react-i18next";
import { useTranslation } from "react-i18next";
import styles from "./DisconnectedBanner.module.css";
import { useClient } from "./ClientContext";
@@ -32,18 +31,16 @@ export function DisconnectedBanner({
className,
...rest
}: DisconnectedBannerProps) {
const clientrp = useClient();
logger.log(clientrp);
const disconnected = clientrp.disconnected;
const { t } = useTranslation();
const { disconnected } = useClient();
return (
<>
{disconnected && (
<Trans>
<div className={classNames(styles.banner, className)} {...rest}>
{children}
Connectivity to the server has been lost.
</div>
</Trans>
<div className={classNames(styles.banner, className)} {...rest}>
{children}
{t("Connectivity to the server has been lost.")}
</div>
)}
</>
);