import { Box, Container, Grid, GridItem, Heading, HStack, Icon, Link, Select, Text, useColorMode, useToast, VStack } from "@chakra-ui/react"; import React, { useContext, useEffect } from "react"; import GlobalStateContext from "../Contexts/GlobalStateContext"; import Pagination from "../components/Pagination"; import { MdContentCopy, MdOutlineErrorOutline } from "react-icons/md"; import ToastBox from "../components/ToastBox"; import bannerImage from "../assets/images/bannerImg.png"; import { useParams } from "react-router-dom"; const MainNetOveriew = () => { const { overview } = useContext(GlobalStateContext); const { colorMode} = useColorMode(); const params = useParams() const toast = useToast() useEffect(() => { window.scrollTo({ top: 0, behavior: "smooth" }); // Scroll to top smoothly when params change }, []); function copyToClipboard(text) { navigator.clipboard .writeText(text) .then(() => { // console.log('Text copied to clipboard'); // alert('Text copied to clipboard'); toast({ render: () => ( ), }); }) .catch((err) => { console.error("Failed to copy text: ", err); }); } return ( Main net ID - {params?.id} {/* View total number of records */} Sr. no Transactions {overview.map((transaction, index) => ( {index + 1}. {/* */} copyToClipboard(transaction.description)} /> Sender: copyToClipboard(transaction.sender)} /> Receiver: navigate(`/did-info/${transaction.receiver}`) } > {transaction.receiver} copyToClipboard(transaction.receiver)} /> Smart contract ID : {transaction.contract} Date and Time Stamp : {transaction.date} Amount: {transaction.amount} Transaction type : {transaction.transactionType} {/* */} ))} ); }; export default MainNetOveriew;