mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 05:05:38 -04:00
Fix missing userStatus on title cards across dashboard, recommendations, and filmography
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,10 @@ import type { RecommendedTitle } from "@/lib/types/title";
|
||||
|
||||
export function RecommendationsGrid({
|
||||
recommendations,
|
||||
userStatuses,
|
||||
}: {
|
||||
recommendations: RecommendedTitle[];
|
||||
userStatuses?: Record<string, "watchlist" | "in_progress" | "completed">;
|
||||
}) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
@@ -30,6 +32,7 @@ export function RecommendationsGrid({
|
||||
posterPath={rec.posterPath}
|
||||
releaseDate={rec.releaseDate ?? rec.firstAirDate}
|
||||
voteAverage={rec.voteAverage}
|
||||
userStatus={userStatuses?.[rec.id]}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { getSession } from "@/lib/auth/session";
|
||||
import { getRecommendationsForTitle } from "@/lib/services/discovery";
|
||||
import { getUserStatusesByTitleIds } from "@/lib/services/tracking";
|
||||
import type { RecommendedTitle } from "@/lib/types/title";
|
||||
import { RecommendationsGrid } from "./recommendations-grid";
|
||||
|
||||
@@ -17,5 +19,18 @@ export async function TitleRecommendations({ titleId }: { titleId: string }) {
|
||||
voteAverage: r.voteAverage,
|
||||
}));
|
||||
|
||||
return <RecommendationsGrid recommendations={recommendations} />;
|
||||
const session = await getSession();
|
||||
const userStatuses = session
|
||||
? getUserStatusesByTitleIds(
|
||||
session.user.id,
|
||||
recommendations.map((r) => r.id),
|
||||
)
|
||||
: {};
|
||||
|
||||
return (
|
||||
<RecommendationsGrid
|
||||
recommendations={recommendations}
|
||||
userStatuses={userStatuses}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user