perf: fetch session and comments in parallel, pass current user to comment components instead of useSession

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Sonnet 5.5 committed 2026-10-03 08:48:15 -04:00
1 parent 1d8b8358ca
commit 6527c7081c
6 files changed
+56 -36

No files matched your search

+4 -1
View File
@@ -4,8 +4,11 @@ import { desc, eq, sql } from "drizzle-orm";
import { db } from "@/lib/db";
import * as schema from "@/lib/db/schema";
/** The public profile fields of a commenter (also used for the signed-in user in comment UI) */
export type CommentUser = Pick<typeof schema.user.$inferSelect, "id" | "name" | "image">;
export type CommentWithUser = typeof schema.comment.$inferSelect & {
user: Pick<typeof schema.user.$inferSelect, "id" | "name" | "image">;
user: CommentUser;
};
/**