import { View, Text, TouchableOpacity, Image as NativeImage, } from "react-native"; import React, { memo, useContext } from "react"; import { useTailwind } from "tailwind-rn"; import { Image } from "expo-image"; import { Video, ResizeMode } from "expo-av"; import { FeedShowVideoContext } from "../../screeens/Stream/FeedStream"; import { SameCityShowVideoContext } from "../../screeens/Stream/FollowStream"; import { useNavigation } from "@react-navigation/native"; function StreamerCard({ data, screen }) { const navigation = useNavigation(); const showVideo = useContext( screen === "feed" ? FeedShowVideoContext : SameCityShowVideoContext ); const tailwind = useTailwind(); const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk"; return ( navigation.navigate("StreamerProfile", { mid: data?.mid }) } > {/* 上方信息区域 */} {data?.name} {data?.gender === 0 ? ( ) : ( )} {data?.age}岁 {data?.city} 全网粉丝:{data?.fans}万 {/* 中部媒体区域 */} {showVideo.includes(data?.mid) && ( {data?.album?.images.map((item, index) => { if (index > 1) return; return ( {index === 1 && data?.album?.images.length > 2 && ( +{data?.album?.images.length - 2} )} ); })} {/* 下方标签区 */} {data?.tag.map((item, index) => { if (index > 2) return; return ( {item} ); })} {data?.platforms.map((item, index) => { if (index > 5) return; return ( {index === 5 && data?.platforms.length > 6 && ( +{data?.platforms.length - 6} )} ); })} ); } export default memo(StreamerCard);