import { useState } from "react"; import { Box, Link, Typography, SvgIcon, Button, useTheme } from "@mui/material"; import { styled } from "@mui/material/styles"; import GhostStyledIcon from "../../components/Icon/GhostIcon"; import Paper from "../../components/Paper/Paper"; import GhostIcon from "../../assets/icons/ghost-nav-header.svg?react"; import EthIcon from "../../assets/tokens/ETH.svg?react"; import { useSwitchChain } from 'wagmi'; import toast from "react-hot-toast"; export default function NotFound({ chainId, chainExists, wrongNetworkToastId, setWrongNetworkToastId }) { const theme = useTheme(); const { chains, switchChain } = useSwitchChain(); const [networkId, setNetworkId] = useState(chainId); const handleChange = (newChainId) => { const chainName = chains.find((chain) => chain.id === newChainId).name; toast.dismiss(wrongNetworkToastId); const toastId = toast.loading(`Trying to connect to ${chainName} network... Wait please`, { position: 'bottom-right' }); setWrongNetworkToastId(toastId); setNetworkId(newChainId); switchChain({ chainId: newChainId }); } return ( {chainExists ? <> Page not found : Select Network Here is the list of networks where the protocol has been deployed. } > {chains.map(chain => { return ( ) })} } ); }