+
+
+
+
+
+ {did ? : null}
+
+ {handle}
+
+
+
+ •
+
+
+
+
+
+
+
+ {
+ "use server";
+ await ensureUser();
+ await createVote({
+ subjectAuthorDid: author,
+ subjectCid: cid,
+ subjectRkey: rkey,
+ subjectCollection: PostCollection,
+ });
+ }}
+ unvoteAction={async () => {
+ "use server";
+ await ensureUser();
+ const vote = await getVoteForPost(id);
+ if (!vote) {
+ // TODO: Show error notification
+ console.error("Vote not found for post", id);
+ return;
+ }
+ await deleteVote(vote.rkey);
+ }}
+ initialState={
+ (await getUser())?.did === author
+ ? "authored"
+ : isUpvoted
+ ? "voted"
+ : "unvoted"
+ }
+ votes={votes}
+ />
+
+
+ {commentCount}
+
+
+
+ {user ? (
+
+
+
+
+ {user?.did === author ? (
+
+ ) : null}
+
+
+ ) : null}
+
+
+
+ {/*
{
"use server";
@@ -139,7 +242,7 @@ export async function PostCard({
) : null}