Fix home page navigation and add TMDB cast page
Home page cards now check library store and link directly to EntryDetailsPage when the entry is already added. Created useTmdbEntryLink hook for shared library-check logic. Added TmdbCastsPage with filter/search/sort for TMDB preview cast & crew, and limited credits to 12 on TmdbPreviewPage.
This commit is contained in:
1 parent
6c2fd3837b
commit
8671184dc5
9 files changed
+540
-136
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import type { TmdbEntry } from '@/types';
|
||||
import { Link } from "react-router-dom";
|
||||
import type { TmdbEntry } from "@/types";
|
||||
import { useTmdbEntryLink } from "@/hooks/useTmdbEntryLink";
|
||||
|
||||
interface MiniPosterCardProps {
|
||||
entry: TmdbEntry;
|
||||
@@ -7,16 +8,18 @@ interface MiniPosterCardProps {
|
||||
}
|
||||
|
||||
export function MiniPosterCard({ entry, hideTitle }: MiniPosterCardProps) {
|
||||
const title = entry.title || entry.name || 'Untitled';
|
||||
const title = entry.title || entry.name || "Untitled";
|
||||
const poster = entry.poster_path
|
||||
? `https://image.tmdb.org/t/p/w342${entry.poster_path}`
|
||||
: null;
|
||||
const isTv = entry.media_type === 'tv' || !!entry.name;
|
||||
const linkTo = `/entry/tmdb/${isTv ? 'tv' : 'movie'}/${entry.id}`;
|
||||
const { linkTo } = useTmdbEntryLink(entry);
|
||||
|
||||
return (
|
||||
<Link to={linkTo} className="group space-y-2">
|
||||
<div className="relative overflow-hidden rounded-lg bg-muted" style={{ aspectRatio: '2/3' }}>
|
||||
<div
|
||||
className="relative overflow-hidden rounded-lg bg-muted"
|
||||
style={{ aspectRatio: "2/3" }}
|
||||
>
|
||||
{poster ? (
|
||||
<img
|
||||
src={poster}
|
||||
|
||||
Reference in new issue
Block a user