import React from "react"; import { Animated, Pressable, View } from "react-native"; import { Text } from "@/components/common/Text"; import { useTVFocusAnimation } from "@/components/tv/hooks/useTVFocusAnimation"; import { useScaledTVTypography } from "@/constants/TVTypography"; type SearchType = "Library" | "Discover"; interface TVSearchTabBadgeProps { label: string; isSelected: boolean; onPress: () => void; hasTVPreferredFocus?: boolean; disabled?: boolean; } const TVSearchTabBadge: React.FC = ({ label, isSelected, onPress, hasTVPreferredFocus = false, disabled = false, }) => { const typography = useScaledTVTypography(); const { focused, handleFocus, handleBlur, animatedStyle } = useTVFocusAnimation({ duration: 150 }); // Design language: white for focused/selected, transparent white for unfocused const getBackgroundColor = () => { if (focused) return "#fff"; if (isSelected) return "rgba(255,255,255,0.25)"; return "rgba(255,255,255,0.1)"; }; const getTextColor = () => { if (focused) return "#000"; return "#fff"; }; return ( {label} ); }; export interface TVSearchTabBadgesProps { searchType: SearchType; setSearchType: (type: SearchType) => void; showDiscover: boolean; disabled?: boolean; } export const TVSearchTabBadges: React.FC = ({ searchType, setSearchType, showDiscover, disabled = false, }) => { if (!showDiscover) { return null; } return ( setSearchType("Library")} disabled={disabled} /> setSearchType("Discover")} disabled={disabled} /> ); };