import Refresh from "@material-symbols/svg-400/rounded/autorenew.svg"; import BookmarkAdd from "@material-symbols/svg-400/rounded/bookmark_add.svg"; import MoreHoriz from "@material-symbols/svg-400/rounded/more_horiz.svg"; import MovieInfo from "@material-symbols/svg-400/rounded/movie_info.svg"; import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import Theaters from "@material-symbols/svg-400/rounded/theaters-fill.svg"; import { LinearGradient } from "expo-linear-gradient"; import { Stack } from "expo-router"; import { Fragment } from "react"; import { useTranslation } from "react-i18next"; import { type ImageStyle, Platform, View } from "react-native"; import { em, max, md, min, percent, px, rem, type Stylable, type Theme, useYoshiki, vh, } from "yoshiki/native"; import { WatchListInfo } from "~/components/items/watchlist-info"; import { Rating } from "~/components/rating"; import { type Genre, type KImage, Show, type Studio, type WatchStatusV, } from "~/models"; import { A, Chip, Container, capitalize, DottedSeparator, GradientImageBackground, H1, H2, Head, HR, IconButton, IconFab, LI, Link, Menu, P, Poster, Skeleton, tooltip, ts, UL, } from "~/primitives"; import { useAccount } from "~/providers/account-context"; import { Fetch, type QueryIdentifier, useMutation } from "~/query"; import { displayRuntime, getDisplayDate } from "~/utils"; const ButtonList = ({ kind, slug, playHref, trailerUrl, watchStatus, }: { kind: "movie" | "serie" | "collection"; slug: string; playHref: string | null; trailerUrl: string | null; watchStatus: WatchStatusV | null; }) => { const account = useAccount(); const { css, theme } = useYoshiki(); const { t } = useTranslation(); const metadataRefreshMutation = useMutation({ method: "POST", path: [kind, slug, "refresh"], invalidate: null, }); return ( {playHref !== null && ( )} {trailerUrl && ( )} {kind !== "collection" && ( )} {(kind === "movie" || account?.isAdmin === true) && ( {kind === "movie" && ( <> {/* downloader(kind, slug)} */} {/* label={t("home.episodeMore.download")} */} {/* /> */} )} {account?.isAdmin === true && ( <> {kind === "movie" &&
} metadataRefreshMutation.mutate()} /> )}
)}
); }; export const TitleLine = ({ kind, slug, playHref, name, tagline, date, rating, runtime, poster, trailerUrl, studios, watchStatus, ...props }: { kind: "movie" | "serie" | "collection"; slug: string; playHref: string | null; name: string; tagline: string | null; date: string | null; rating: number | null; runtime: number | null; poster: KImage | null; trailerUrl: string | null; studios: Studio[] | null; watchStatus: WatchStatusV | null; } & Stylable) => { const { css, theme } = useYoshiki(); const { t } = useTranslation(); return (

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

{date && (

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

)}

{tagline && (

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

)} {rating !== null && rating !== 0 && ( <> )} {runtime && ( <>

{displayRuntime(runtime)}

)}
{studios !== null && (

theme.user.paragraph, })} > {t("show.studios")}:{" "} {studios.map((studio, i) => (

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

{studio.name} ))}

)}
); }; TitleLine.Loader = ({ kind, ...props }: { kind: "serie" | "movie" | "collection"; }) => { const { css, theme } = useYoshiki(); return ( {kind !== "collection" && ( )} {kind === "movie" && } ); }; const Description = ({ description, tags, genres, ...props }: { description: string | null; tags: string[]; genres: Genre[]; } & Stylable) => { const { t } = useTranslation(); const { css } = useYoshiki(); return (

theme.user.paragraph, })} > {t("show.genre")}:{" "} {genres.map((genre, i) => (

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

{t(`genres.${genre}`)} ))}

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

{t("show.tags")}:

{tags.map((tag) => ( ))}

{t("show.genre")}

{genres.length ? ( ) : (

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

)}
); }; Description.Loader = ({ ...props }: object) => { const { t } = useTranslation(); const { css } = useYoshiki(); return (

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

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

))}

{t("show.tags")}:

{[...Array(3)].map((_, i) => ( ))}

{t("show.genre")}

    {[...Array(3)].map((_, i) => (
  • ))}
); }; export const Header = ({ kind, slug, }: { kind: "movie" | "serie"; slug: string; }) => { const { css, theme } = useYoshiki(); const { t } = useTranslation(); return ( <> (

{t("show.links")}:

{Object.entries(data.externalId!) .filter(([_, data]) => data.link) .map(([name, data]) => ( ))}
{/* {type === "show" && ( */} {/* */} {/* )} */}
)} Loader={() => ( <> )} /> ); }; Header.query = ( kind: "serie" | "movie" | "collection", slug: string, ): QueryIdentifier => ({ parser: Show, path: ["api", `${kind}s`, slug], params: { with: ["studios"], }, });