perf(frontend): eliminate author profile waterfall — use thought.author directly
This commit is contained in:
@@ -3,29 +3,19 @@ import { ThoughtCard } from "./thought-card";
|
||||
|
||||
interface ThoughtThreadProps {
|
||||
thought: ThoughtThreadType;
|
||||
authorDetails: Map<string, { avatarUrl?: string | null }>;
|
||||
currentUser: Me | null;
|
||||
isReply?: boolean;
|
||||
}
|
||||
|
||||
export function ThoughtThread({
|
||||
thought,
|
||||
authorDetails,
|
||||
currentUser,
|
||||
isReply = false,
|
||||
}: ThoughtThreadProps) {
|
||||
const author = {
|
||||
username: thought.author.username,
|
||||
displayName: thought.author.displayName,
|
||||
avatarUrl: thought.author.avatarUrl, // API-provided avatar (from DB COALESCE)
|
||||
...authorDetails.get(thought.author.username), // override for local users
|
||||
};
|
||||
|
||||
return (
|
||||
<div id={`thought-thread-${thought.id}`} className="flex flex-col gap-0">
|
||||
<ThoughtCard
|
||||
thought={thought}
|
||||
author={author}
|
||||
currentUser={currentUser}
|
||||
isReply={isReply}
|
||||
/>
|
||||
@@ -39,7 +29,6 @@ export function ThoughtThread({
|
||||
<ThoughtThread
|
||||
key={reply.id}
|
||||
thought={reply}
|
||||
authorDetails={authorDetails}
|
||||
currentUser={currentUser}
|
||||
isReply={true}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user