feat: enhance review handling by adding actor URL support across multiple components
All checks were successful
CI / Check / Test (push) Successful in 1h3m53s

This commit is contained in:
2026-06-30 03:34:52 +02:00
parent 9f6ba55afc
commit d7fbf8d9e2
7 changed files with 21 additions and 7 deletions

View File

@@ -12,9 +12,10 @@ type ReviewCardProps = {
userName?: string
userId?: string
isFederated?: boolean
actorUrl?: string
}
export function ReviewCard({ movie, review, userName, userId, isFederated }: ReviewCardProps) {
export function ReviewCard({ movie, review, userName, userId, isFederated, actorUrl }: ReviewCardProps) {
return (
<Card size="sm">
<CardContent className="flex gap-3">
@@ -28,6 +29,10 @@ export function ReviewCard({ movie, review, userName, userId, isFederated }: Rev
<Link to="/users/$id" params={{ id: userId }} className="relative z-10 font-semibold text-primary">
{userName}
</Link>
) : actorUrl ? (
<a href={actorUrl} target="_blank" rel="noopener noreferrer" className="relative z-10 font-semibold text-primary">
{userName}
</a>
) : (
<span>{userName}</span>
)}

View File

@@ -29,9 +29,9 @@ export const feedEntryDtoSchema = z.object({
movie: movieDtoSchema,
review: reviewDtoSchema,
user_id: z.string().uuid(),
user_email: z.string(),
user_display_name: z.string(),
is_federated: z.boolean(),
actor_url: z.string().optional(),
})
export type FeedEntryDto = z.infer<typeof feedEntryDtoSchema>

View File

@@ -115,8 +115,9 @@ function FeedTab() {
movie={entry.movie}
review={entry.review}
userName={entry.user_display_name}
userId={entry.user_id}
userId={entry.is_federated ? undefined : entry.user_id}
isFederated={entry.is_federated}
actorUrl={entry.actor_url}
/>
)
return entry.user_id === auth?.user_id ? (