diff --git a/src/app/profile/[address]/page.tsx b/src/app/profile/[address]/page.tsx index ac9edd5b..a71bb653 100644 --- a/src/app/profile/[address]/page.tsx +++ b/src/app/profile/[address]/page.tsx @@ -170,7 +170,7 @@ export default function ProfilePage() { } // --------------------------------------------------------------------------- -// Profile Header (unchanged from #501) +// Profile Header — Social Credibility Trust Dashboard // --------------------------------------------------------------------------- function ProfileHeader({ @@ -205,28 +205,30 @@ function ProfileHeader({ cooldownRemaining: number; }) { const displayName = agentMeta?.name ?? fcProfile?.displayName ?? null; + const hasFarcaster = dbUser?.fid != null && dbUser?.username != null; + const hasX = dbUser?.twitter != null; + const hasQuotient = dbUser?.quotient_score != null; return ( -
+
+ {/* Primary identity */}
- {/* Avatar */} {fcProfile?.pfpUrl ? ( // eslint-disable-next-line @next/next/no-img-element ) : ( -
+
{address.slice(2, 4).toUpperCase()}
)}
- {/* Name + badge */}

{fcLoading && agentLoading @@ -235,7 +237,7 @@ function ProfileHeader({

{!agentLoading && ( isAgent ? ( - + AI Agent ) : ( @@ -246,122 +248,200 @@ function ProfileHeader({ )}
- {/* Secondary identity line */} -
- {fcProfile && ( - - @{fcProfile.username} - - )} - {dbUser?.twitter && ( - - @{dbUser.twitter} - - )} + {/* Bio */} + {agentMeta?.description ? ( +

{agentMeta.description}

+ ) : fcProfile?.bio ? ( +

{fcProfile.bio}

+ ) : null} + + {/* Agent metadata */} + {agentMeta && ( +
+ {agentMeta.llmModel && ( + Model: {agentMeta.llmModel} + )} + {agentMeta.genre && ( + Genre: {agentMeta.genre} + )} + {agentMeta.registeredAt && ( + Registered: + {new Date(agentMeta.registeredAt).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })} + + )} +
+ )} +
+
+ + {/* Trust dashboard — social credibility cards */} +
+ {/* Farcaster card */} + {hasFarcaster && ( +
+
+ Farcaster +
+ {dbUser?.power_badge && ( + Power + )} + {dbUser?.is_pro_subscriber && ( + Pro + )} +
+
- {truncateAddress(address)} + @{dbUser!.username} + FID {dbUser!.fid} +
+
+ + {(dbUser?.follower_count ?? 0).toLocaleString()} + + followers +
+
+ + {(dbUser?.following_count ?? 0).toLocaleString()} + + following +
+
+ )} - {/* Agent metadata */} - {agentMeta && ( -
- {agentMeta.description && ( -

{agentMeta.description}

+ {/* X/Twitter card */} + {hasX && ( +
+
+ X / Twitter + {dbUser.x_verified && ( + Verified )} -
- {agentMeta.llmModel && ( - Model: {agentMeta.llmModel} - )} - {agentMeta.genre && ( - Genre: {agentMeta.genre} +
+ + @{dbUser.twitter} + + {dbUser.x_display_name && dbUser.x_display_name !== dbUser.twitter && ( + {dbUser.x_display_name} + )} + {(dbUser.x_followers_count != null || dbUser.x_following_count != null) && ( +
+ {dbUser.x_followers_count != null && ( +
+ + {dbUser.x_followers_count.toLocaleString()} + + followers +
)} - {agentMeta.registeredAt && ( - Registered: - {new Date(agentMeta.registeredAt).toLocaleDateString("en-US", { - month: "short", - day: "numeric", - year: "numeric", - })} - + {dbUser.x_following_count != null && ( +
+ + {dbUser.x_following_count.toLocaleString()} + + following +
)}
-
- )} - - {/* Farcaster bio (only show when no agent description is present) */} - {!agentMeta?.description && fcProfile?.bio && ( -

{fcProfile.bio}

- )} + )} +
+ )} - {/* Social stats from DB */} - {dbUser && ( -
- {dbUser.follower_count > 0 && ( - {dbUser.follower_count.toLocaleString()} followers - )} - {dbUser.following_count > 0 && ( - {dbUser.following_count.toLocaleString()} following - )} - {dbUser.quotient_score !== null && ( - QS: {dbUser.quotient_score} - )} - {dbUser.x_followers_count !== null && ( - X: {dbUser.x_followers_count.toLocaleString()} followers + {/* Quotient Score card */} + {hasQuotient && ( +
+ Quotient Score +
+ {dbUser!.quotient_score} + {dbUser!.quotient_rank != null && ( + Rank #{dbUser!.quotient_rank.toLocaleString()} )}
- )} +
+ )} - {/* Cumulative claimed royalties */} + {/* Wallet identity card — always shown */} +
+ Wallet + {claimedRoyalties && claimedRoyalties > BigInt(0) && ( -
- Royalties claimed: {formatPrice(formatUnits(claimedRoyalties, 18))} {RESERVE_LABEL} +
+ Royalties: {formatPrice(formatUnits(claimedRoyalties, 18))} {RESERVE_LABEL}
)} +
+
- {/* Refresh button (own profile only) */} - {isOwnProfile && ( -
- - {refreshError && ( - {refreshError} - )} -
+ {/* Refresh button (own profile only) */} + {isOwnProfile && ( +
+ + {refreshError && ( + {refreshError} )}
-
+ )}
); } +// --------------------------------------------------------------------------- +// Copy to clipboard button +// --------------------------------------------------------------------------- + +function CopyButton({ text }: { text: string }) { + const [copied, setCopied] = useState(false); + return ( + + ); +} + // --------------------------------------------------------------------------- // Stories Tab — writer stats + story portfolio // ---------------------------------------------------------------------------