mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
Clean up settings section design: consolidate backup cards, add hover-reveal actions with tooltips, improve icon sizing across components, and replace custom timeAgo helper with date-fns formatDistanceToNow in webhook card. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { IconPlayerPlay } from "@tabler/icons-react";
|
|
import { getContinueWatchingFeed } from "@/lib/services/discovery";
|
|
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
|
import type { ContinueWatchingItemProps } from "./continue-watching-card";
|
|
import { ContinueWatchingList } from "./continue-watching-list";
|
|
import { FeedSection } from "./feed-section";
|
|
|
|
export async function ContinueWatchingSection({ userId }: { userId: string }) {
|
|
const feed = await getContinueWatchingFeed(userId);
|
|
if (feed.length === 0) return null;
|
|
|
|
const items: ContinueWatchingItemProps[] = feed.map((item) => ({
|
|
title: {
|
|
id: item.title.id,
|
|
title: item.title.title,
|
|
backdropPath: tmdbImageUrl(item.title.backdropPath, "w1280"),
|
|
},
|
|
nextEpisode: item.nextEpisode
|
|
? {
|
|
seasonNumber: item.nextEpisode.seasonNumber,
|
|
episodeNumber: item.nextEpisode.episodeNumber,
|
|
name: item.nextEpisode.name,
|
|
stillPath: tmdbImageUrl(
|
|
item.nextEpisode.stillPath,
|
|
"w1280",
|
|
"stills",
|
|
),
|
|
}
|
|
: null,
|
|
totalEpisodes: item.totalEpisodes,
|
|
watchedEpisodes: item.watchedEpisodes,
|
|
}));
|
|
|
|
return (
|
|
<FeedSection
|
|
title="Continue Watching"
|
|
icon={<IconPlayerPlay className="size-5 text-primary" />}
|
|
>
|
|
<ContinueWatchingList items={items} />
|
|
</FeedSection>
|
|
);
|
|
}
|