forked from Ninjalama/streamyfin_mirror
Co-authored-by: lostb1t <coding-mosses0z@icloud.com> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com> Co-authored-by: Gauvino <uruknarb20@gmail.com> Co-authored-by: storm1er <le.storm1er@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Chris <182387676+whoopsi-daisy@users.noreply.github.com> Co-authored-by: arch-fan <55891793+arch-fan@users.noreply.github.com> Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro.local>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
|
import type React from "react";
|
|
import { View, type ViewProps } from "react-native";
|
|
import { GenreTags } from "./GenreTags";
|
|
import { MoviesTitleHeader } from "./movies/MoviesTitleHeader";
|
|
import { Ratings } from "./Ratings";
|
|
import { EpisodeTitleHeader } from "./series/EpisodeTitleHeader";
|
|
import { ItemActions } from "./series/SeriesActions";
|
|
|
|
interface Props extends ViewProps {
|
|
item?: BaseItemDto | null;
|
|
}
|
|
|
|
export const ItemHeader: React.FC<Props> = ({ item, ...props }) => {
|
|
if (!item)
|
|
return (
|
|
<View
|
|
className='flex flex-col space-y-1.5 w-full items-start h-32'
|
|
{...props}
|
|
>
|
|
<View className='w-1/3 h-6 bg-neutral-900 rounded' />
|
|
<View className='w-2/3 h-8 bg-neutral-900 rounded' />
|
|
<View className='w-2/3 h-4 bg-neutral-900 rounded' />
|
|
<View className='w-1/4 h-4 bg-neutral-900 rounded' />
|
|
</View>
|
|
);
|
|
|
|
return (
|
|
<View className='flex flex-col' {...props}>
|
|
<View className='flex flex-col' {...props}>
|
|
<View className='flex flex-row items-center justify-between'>
|
|
<Ratings item={item} className='mb-2' />
|
|
<ItemActions item={item} />
|
|
</View>
|
|
{item.Type === "Episode" && (
|
|
<View>
|
|
<EpisodeTitleHeader item={item} />
|
|
<GenreTags genres={item.Genres!} />
|
|
</View>
|
|
)}
|
|
{item.Type === "Movie" && (
|
|
<View>
|
|
<MoviesTitleHeader item={item} />
|
|
<GenreTags genres={item.Genres!} />
|
|
</View>
|
|
)}
|
|
</View>
|
|
</View>
|
|
);
|
|
};
|