mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-05 17:26:18 +00:00
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { Ionicons } from "@expo/vector-icons";
|
|
import React from "react";
|
|
import { View } from "react-native";
|
|
import { Badge } from "@/components/Badge";
|
|
import { Text } from "@/components/common/Text";
|
|
import { useScaledTVTypography } from "@/constants/TVTypography";
|
|
|
|
export interface TVMetadataBadgesProps {
|
|
year?: number | null;
|
|
duration?: string | null;
|
|
officialRating?: string | null;
|
|
communityRating?: number | null;
|
|
}
|
|
|
|
export const TVMetadataBadges: React.FC<TVMetadataBadgesProps> = React.memo(
|
|
({ year, duration, officialRating, communityRating }) => {
|
|
const typography = useScaledTVTypography();
|
|
|
|
return (
|
|
<View
|
|
style={{
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
flexWrap: "wrap",
|
|
gap: 16,
|
|
marginBottom: 24,
|
|
}}
|
|
>
|
|
{year != null && (
|
|
<Text style={{ color: "white", fontSize: typography.body }}>
|
|
{year}
|
|
</Text>
|
|
)}
|
|
{duration && (
|
|
<Text style={{ color: "white", fontSize: typography.body }}>
|
|
{duration}
|
|
</Text>
|
|
)}
|
|
{officialRating && <Badge text={officialRating} variant='gray' />}
|
|
{communityRating != null && (
|
|
<Badge
|
|
text={communityRating.toFixed(1)}
|
|
variant='gray'
|
|
iconLeft={<Ionicons name='star' size={16} color='gold' />}
|
|
/>
|
|
)}
|
|
</View>
|
|
);
|
|
},
|
|
);
|