"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WrongNetworkPage = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const polymesh_ui_1 = require("@polymathnetwork/polymesh-ui");
const react_i18next_1 = require("react-i18next");
const PolyWalletSvg_1 = require("./assets/PolyWalletSvg");
const PolyWarningSvg_1 = require("./assets/PolyWarningSvg");
const variables_1 = require("../../data/variables");
const constants_1 = require("../../data/constants");
const hardRedirect_1 = require("../../utils/hardRedirect");
const definition_1 = require("../definition");
const WrongNetworkPage = ({ mainPath, apiConfig }) => {
    const { t } = react_i18next_1.useTranslation(definition_1.TranslationNS.WrongNetworkPage);
    const cleanUrl = apiConfig.polyWssNodeUrl.replace(/\/$/, '');
    const supportedNetworkName = constants_1.nameByUrl[cleanUrl].toUpperCase();
    const connect = () => {
        hardRedirect_1.hardRedirect(mainPath);
    };
    return (jsx_runtime_1.jsxs("div", Object.assign({ style: { background: polymesh_ui_1.theme.colors.gradient } }, { children: [jsx_runtime_1.jsxs(polymesh_ui_1.PageWrap, { children: [jsx_runtime_1.jsx(polymesh_ui_1.Box, Object.assign({ pt: "m" }, { children: jsx_runtime_1.jsx(polymesh_ui_1.Icon, { Asset: polymesh_ui_1.icons.SvgPolyText, width: 188, color: "brandMain" }, void 0) }), void 0), jsx_runtime_1.jsxs(polymesh_ui_1.Flex, Object.assign({ justifyContent: "space-between" }, { children: [jsx_runtime_1.jsxs(polymesh_ui_1.Box, Object.assign({ pt: "xxl", pb: "xxxl", width: "50%" }, { children: [jsx_runtime_1.jsx(PolyWarningSvg_1.PolyWarningSvg, { style: { marginLeft: -20 } }, void 0), jsx_runtime_1.jsx(polymesh_ui_1.Heading, Object.assign({ variant: "h4", mb: "m" }, { children: t('heading', { supportedNetworkName }) }), void 0), jsx_runtime_1.jsx(polymesh_ui_1.Paragraph, Object.assign({ color: "gray.2", mb: "m" }, { children: t('instruction', { supportedNetworkName }) }), void 0), jsx_runtime_1.jsxs(polymesh_ui_1.Button, Object.assign({ id: "wrong_network_connect_button", onClick: connect }, { children: [jsx_runtime_1.jsx(polymesh_ui_1.IconCircled, { Asset: polymesh_ui_1.icons.SvgPolyNew, width: 24, height: 24, scale: 0.9, color: "brandMain", mr: "s" }, void 0), t('connectButton')] }), void 0)] }), void 0), jsx_runtime_1.jsx(PolyWalletSvg_1.PolyWalletSvg, {}, void 0)] }), void 0)] }, void 0), jsx_runtime_1.jsx(polymesh_ui_1.Footer, { links: variables_1.footerLinks }, void 0)] }), void 0));
};
exports.WrongNetworkPage = WrongNetworkPage;
//# sourceMappingURL=WrongNetworkPage.js.map