/* * 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 { Movie, QueryIdentifier, Show, getDisplayDate, Genre, Studio } from "@kyoo/models"; import { Container, H1, ImageBackground, Skeleton, Poster, P, tooltip, Link, IconButton, IconFab, Head, HR, H2, UL, LI, A, ts, Button, } from "@kyoo/primitives"; import { Fragment } from "react"; import { useTranslation } from "react-i18next"; import { Platform, Pressable, PressableProps, View } from "react-native"; import { Theme, md, px, min, max, em, percent, rem, vh, useYoshiki, Stylable, } from "yoshiki/native"; import { Fetch } from "../fetch"; import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import Theaters from "@material-symbols/svg-400/rounded/theaters-fill.svg"; const TitleLine = ({ isLoading, slug, name, date, poster, studio, trailerUrl, ...props }: { isLoading: boolean; slug: string; name?: string; date?: string; poster?: string | null; studio?: Studio | null; trailerUrl?: string | null; } & Stylable) => { const { css, theme } = useYoshiki(); const { t } = useTranslation(); return ( {isLoading || (

({ xs: theme.user.heading, md: theme.heading }), })} > {name}

)}
{(isLoading || date) && ( {isLoading || (

({ xs: theme.user.heading, md: theme.heading }), })} > {date}

)}
)} {trailerUrl && }
{isLoading || (studio && (

theme.user.paragraph, display: "flex", })} > {t("show.studio")}:{" "} {isLoading ? ( ) : ( theme.user.link })}> {studio.name} )}

))}
); }; const Description = ({ isLoading, overview, genres, ...props }: { isLoading: boolean; overview?: string | null; genres?: Genre[]; } & Stylable) => { const { t } = useTranslation(); const { css } = useYoshiki(); return (

theme.user.paragraph, })} > {t("show.genre")}:{" "} {(isLoading ? [...Array(3)] : genres!).map((genre, i) => (

{i !== 0 && ", "}

{isLoading ? ( ) : ( {genre.name} )} ))}

{isLoading || (

{overview ?? t("show.noOverview")}

)}

{t("show.genre")}

{isLoading || genres?.length ? (
    {(isLoading ? [...Array(3)] : genres!).map((genre, i) => (
  • {isLoading ? ( ) : ( {genre.name} )}
  • ))}
) : (

{t("show.genre-none")}

)}
); }; export const Header = ({ query, slug }: { query: QueryIdentifier; slug: string }) => { const { css } = useYoshiki(); return ( {({ isLoading, ...data }) => ( <> )} ); };