/* * Kyoo - A portable and vast media library solution. * Copyright (c) Kyoo. * * See AUTHORS.md and LICENSE file in the project root for full license information. * * Kyoo is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Kyoo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kyoo. If not, see . */ import { Collection, CollectionP, KyooImage, QueryIdentifier, useInfiniteFetch, } from "@kyoo/models"; import { Container, H2, ImageBackground, Link, P, focusReset, ts } from "@kyoo/primitives"; import { useTranslation } from "react-i18next"; import { Theme, useYoshiki } from "yoshiki/native"; import { ErrorView } from "../fetch"; export const PartOf = ({ name, overview, thumbnail, href, }: { name: string; overview: string | null; thumbnail: KyooImage | null; href: string; }) => { const { css, theme } = useYoshiki("part-of-collection"); const { t } = useTranslation(); return ( theme.background, fover: { self: { ...focusReset, borderColor: (theme: Theme) => theme.accent }, title: { textDecorationLine: "underline" }, }, })} >

{t("show.partOf")} {name}

{overview}

); }; export const DetailsCollections = ({ type, slug }: { type: "movie" | "show"; slug: string }) => { const { items, error } = useInfiniteFetch(DetailsCollections.query(type, slug)); const { css } = useYoshiki(); if (error) return ; // Since most items dont have collections, not having a skeleton reduces layout shifts. if (!items) return null; return ( {items.map((x) => ( ))} ); }; DetailsCollections.query = (type: "movie" | "show", slug: string): QueryIdentifier => ({ parser: CollectionP, path: [type, slug, "collections"], params: { limit: 0, }, infinite: true, });