mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-16 16:18:09 +00:00
Strengthens code quality guidelines by establishing strict TypeScript practices that prohibit `any` types and minimize type suppressions. Updates Copilot instructions to emphasize production-ready code with comprehensive type safety rules, error handling requirements, and reliability standards. Explicitly discourages type escape hatches in favor of proper type definitions. Refactors navigation implementation to use URLSearchParams instead of object-based params, eliminating the need for type suppression while maintaining functionality. Removes unnecessary type error suppressions and unused properties throughout codebase, aligning with new standards.
41 lines
1.4 KiB
TypeScript
41 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/seerr/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("seerr.cast")}</Text>
|
|
<FlashList
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
data={details?.credits.cast}
|
|
ItemSeparatorComponent={() => <View className='w-2' />}
|
|
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;
|