"use client"; import { Address } from "@scaffold-ui/components"; import type { NextPage } from "next"; import { formatEther } from "viem"; import { useScaffoldEventHistory } from "~~/hooks/scaffold-eth"; const ContributionsPage: NextPage = () => { const { data: contributionEvents, isLoading } = useScaffoldEventHistory({ contractName: "CrowdFund", eventName: "Contribution", }); if (isLoading) return (
); return (

All Contributions

{!contributionEvents || contributionEvents.length === 0 ? ( ) : ( contributionEvents.map((event, index) => { return ( ); }) )}
From Value
No events found
{formatEther(event.args?.[1] || 0n)} ETH
); }; export default ContributionsPage;