mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
- Change primary argument from TMDB size string (`w500`, `w1280`, etc.) to category name (`posters`, `backdrops`, `stills`, `logos`, `profiles`); optional size override remains as third argument - Update all call sites across services, actions, pages, and route handlers to use the new category-based API - Update image.test.ts to match the new signature and replace size-mapping test descriptions with category-name descriptions
33 lines
939 B
TypeScript
33 lines
939 B
TypeScript
import { IconThumbUp } from "@tabler/icons-react";
|
|
import { getRecommendationsFeed } from "@/lib/services/discovery";
|
|
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
|
import { FeedSection } from "./feed-section";
|
|
import { TitleGrid } from "./title-grid";
|
|
|
|
export async function RecommendationsSection({ userId }: { userId: string }) {
|
|
const feed = await getRecommendationsFeed(userId);
|
|
if (feed.length === 0) return null;
|
|
|
|
const items = feed
|
|
.filter((item) => !!item)
|
|
.slice(0, 10)
|
|
.map((t) => ({
|
|
id: t.id,
|
|
tmdbId: t.tmdbId,
|
|
type: t.type,
|
|
title: t.title,
|
|
posterPath: tmdbImageUrl(t.posterPath, "posters"),
|
|
releaseDate: t.releaseDate ?? t.firstAirDate,
|
|
voteAverage: t.voteAverage,
|
|
}));
|
|
|
|
return (
|
|
<FeedSection
|
|
title="Recommended for You"
|
|
icon={<IconThumbUp className="size-5 text-primary" />}
|
|
>
|
|
<TitleGrid items={items} />
|
|
</FeedSection>
|
|
);
|
|
}
|