# Codeblocks **Published by:** [Chris' Blog](https://paragraph.com/@chris-blog/) **Published on:** 2024-10-24 **URL:** https://paragraph.com/@chris-blog/codeblocks ## Content UI Renderingreturn ( <main className="container mx-auto p-4"> <h1 className="text-2xl font-bold mb-4"> Decentralized Voting Application </h1> <ConnectButton /> {votingStatus ? ( address ? ( <Card className="mt-4"> <CardContent> <p>Connected Account: {address}</p> <p>Remaining Time: {Number(remainingTime)} seconds</p> {!canVote ? ( <div className="mt-4"> <Input type="number" placeholder="Enter Candidate Index" value={number} onChange={(e) => setNumber(e.target.value)} className="mb-2" /> <Button onClick={vote}>Vote</Button> </div> ) : ( <p>You have already voted</p> )} <div className="mt-4"> <h2 className="text-xl font-semibold mb-2">Candidates</h2> <ul> {candidates.map((candidate) => ( <li key={candidate.index}> {candidates.indexOf(candidate)}: {candidate.name} -{" "} {Number(candidate.voteCount)} votes </li> ))} </ul> </div> </CardContent> </Card> ) : ( <p>Please connect your wallet to vote</p> ) ) : ( <p>Voting has finished</p> )} </main> ); ## Publication Information - [Chris' Blog](https://paragraph.com/@chris-blog/): Publication homepage - [All Posts](https://paragraph.com/@chris-blog/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@chris-blog): Subscribe to updates