"use client"; import { useState } from "react"; import { AssertionWithIdAndState } from "../types"; import { Address } from "@scaffold-ui/components"; import { formatEther } from "viem"; import { useScaffoldWriteContract } from "~~/hooks/scaffold-eth"; import { useChallengeState } from "~~/services/store/challengeStore"; import { ZERO_ADDRESS } from "~~/utils/scaffold-eth/common"; const getStateName = (state: number) => { switch (state) { case 0: return "Invalid"; case 1: return "Asserted"; case 2: return "Proposed"; case 3: return "Disputed"; case 4: return "Settled"; case 5: return "Expired"; default: return "Invalid"; } }; // Helper function to format timestamp to UTC const formatTimestamp = (timestamp: bigint | string | number) => { const timestampNumber = Number(timestamp); const date = new Date(timestampNumber * 1000); // Convert from seconds to milliseconds return date.toLocaleString(); }; const Description = ({ assertion }: { assertion: AssertionWithIdAndState }) => { return (