mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { FlashList } from "@shopify/flash-list";
|
|
import type React from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { View, type ViewProps } from "react-native";
|
|
import { Text } from "@/components/common/Text";
|
|
import PersonPoster from "@/components/jellyseerr/PersonPoster";
|
|
import type { MovieDetails } from "@/utils/jellyseerr/server/models/Movie";
|
|
import type { TvDetails } from "@/utils/jellyseerr/server/models/Tv";
|
|
|
|
const CastSlide: React.FC<
|
|
{ details?: MovieDetails | TvDetails } & ViewProps
|
|
> = ({ details, ...props }) => {
|
|
const { t } = useTranslation();
|
|
return (
|
|
details?.credits?.cast &&
|
|
details?.credits?.cast?.length > 0 && (
|
|
<View {...props}>
|
|
<Text className='text-lg font-bold mb-2 px-4'>
|
|
{t("jellyseerr.cast")}
|
|
</Text>
|
|
<FlashList
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
data={details?.credits.cast}
|
|
ItemSeparatorComponent={() => <View className='w-2' />}
|
|
estimatedItemSize={15}
|
|
keyExtractor={(item) => item?.id?.toString()}
|
|
contentContainerStyle={{ paddingHorizontal: 16 }}
|
|
renderItem={({ item }) => (
|
|
<PersonPoster
|
|
id={item.id.toString()}
|
|
posterPath={item.profilePath}
|
|
name={item.name}
|
|
subName={item.character}
|
|
/>
|
|
)}
|
|
/>
|
|
</View>
|
|
)
|
|
);
|
|
};
|
|
|
|
export default CastSlide;
|