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
31 lines
941 B
TypeScript
31 lines
941 B
TypeScript
import { IconBooks } from "@tabler/icons-react";
|
|
import { getNewAvailableFeed } from "@/lib/services/discovery";
|
|
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
|
import { FeedSection } from "./feed-section";
|
|
import { TitleGrid } from "./title-grid";
|
|
|
|
export async function LibrarySection({ userId }: { userId: string }) {
|
|
const feed = await getNewAvailableFeed(userId);
|
|
if (feed.length === 0) return null;
|
|
|
|
const items = feed.slice(0, 10).map((t) => ({
|
|
id: t.titleId,
|
|
tmdbId: t.tmdbId,
|
|
type: t.type,
|
|
title: t.title,
|
|
posterPath: tmdbImageUrl(t.posterPath, "posters"),
|
|
releaseDate: t.releaseDate ?? t.firstAirDate,
|
|
voteAverage: t.voteAverage,
|
|
userStatus: t.userStatus as "watchlist" | "in_progress" | "completed",
|
|
}));
|
|
|
|
return (
|
|
<FeedSection
|
|
title="In Your Library"
|
|
icon={<IconBooks className="size-5 text-primary" />}
|
|
>
|
|
<TitleGrid items={items} />
|
|
</FeedSection>
|
|
);
|
|
}
|