import { type ReactNode } from "react"; import { hueOf, hueTileGradient } from "../lib/hueTile"; import { navItemAttrs } from "../lib/listNav"; // A browse tile split in two: the TOP half shows up to 2 montage posters (from /api/plex/image/{key}), // the BOTTOM half is a solid colour-hash band that carries the label — so the text is always readable // (a full-bleed poster collage drowned it). A group with no art falls back to an all-colour tile, never // blank. Shared by the Discover genre tiles and the Playlist/Collection browse tiles. export default function PosterTile({ title, subtitle, topRight, art, onClick, className, navIndex, }: { title: string; subtitle?: ReactNode; // a bottom sub-line under the title (e.g. "12 items · 4h 30m") topRight?: ReactNode; // top-right corner content on the colour band (e.g. an icon) art?: string[]; // up to 2 poster rating_keys; fewer/none falls back to the colour hash onClick: () => void; className?: string; // caller sets the height (e.g. "h-20" / "h-28") navIndex?: number; // position in a keyboard-walkable grid (lib/listNav); Enter is the button's own }) { const posters = (art ?? []).slice(0, 2); const band = hueTileGradient(hueOf(title)); return ( ); }