diff --git a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx b/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx
index c0eac21e..cab8f0f5 100644
--- a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx
@@ -1,6 +1,10 @@
"use client";
-import { PubLeafletBlocksPoll, PubLeafletPollDefinition, PubLeafletPollVote } from "lexicons/api";
+import {
+ PubLeafletBlocksPoll,
+ PubLeafletPollDefinition,
+ PubLeafletPollVote,
+} from "lexicons/api";
import { useState, useEffect } from "react";
import { ButtonPrimary, ButtonSecondary } from "components/Buttons";
import { useIdentityData } from "components/IdentityProvider";
@@ -10,6 +14,9 @@ import { PollData } from "./fetchPollData";
import { Popover } from "components/Popover";
import LoginForm from "app/login/LoginForm";
import { BlueskyTiny } from "components/Icons/BlueskyTiny";
+import { getVoterIdentities, VoterIdentity } from "./getVoterIdentities";
+import { Json } from "supabase/database.types";
+import { InfoSmall } from "components/Icons/InfoSmall";
// Helper function to extract the first option from a vote record
const getVoteOption = (voteRecord: any): string | null => {
@@ -101,7 +108,7 @@ export const PublishedPollBlock = (props: {
setShowResults={setShowResults}
optimisticVote={optimisticVote}
/>
- {isCreator && !hasVoted && (
+ {!hasVoted && (
))}
-
-
- {isCreator && (
-
+ }
+ onOpenChange={handleOpenChange}
+ className="w-64 max-h-80"
+ >
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+ );
+};
+
const PollResult = (props: {
option: PubLeafletPollDefinition.Option;
votes: number;
+ voteRecords: { voter_did: string; record: Json }[];
totalVotes: number;
winner: boolean;
}) => {
@@ -258,7 +326,7 @@ const PollResult = (props: {
className="pollResultContent text-accent-contrast relative flex gap-2 justify-between z-10"
>
{props.option.text}
-
{props.votes}
+
{
+ const identities = await Promise.all(
+ dids.map(async (did) => {
+ try {
+ const resolved = await idResolver.did.resolve(did);
+ const handle = resolved?.alsoKnownAs?.[0]
+ ? resolved.alsoKnownAs[0].slice(5) // Remove "at://" prefix
+ : null;
+ return {
+ did,
+ handle,
+ };
+ } catch (error) {
+ console.error(`Failed to resolve DID ${did}:`, error);
+ return {
+ did,
+ handle: null,
+ };
+ }
+ }),
+ );
+
+ return identities;
+}
diff --git a/components/Popover.tsx b/components/Popover.tsx
index e30fcdfb..0816d76e 100644
--- a/components/Popover.tsx
+++ b/components/Popover.tsx
@@ -43,7 +43,7 @@ export const Popover = (props: {
max-w-(--radix-popover-content-available-width)
max-h-(--radix-popover-content-available-height)
border border-border rounded-md shadow-md
- overflow-y-scroll no-scrollbar
+ overflow-y-scroll
${props.className}
`}
side={props.side}