import { Platform, TouchableOpacity, View } from "react-native"; import { Tag } from "@/components/GenreTags"; // @expo/ui's SwiftUI native module (ExpoUI) does not exist in tvOS builds. // A static top-level import crashes the route tree on tvOS at module load. // Load it lazily and only off-TV; TV never renders this component. const { Button, Host, HStack, Spacer } = Platform.isTV ? ({} as typeof import("@expo/ui/swift-ui")) : require("@expo/ui/swift-ui"); const { buttonStyle } = Platform.isTV ? ({} as typeof import("@expo/ui/swift-ui/modifiers")) : require("@expo/ui/swift-ui/modifiers"); type SearchType = "Library" | "Discover"; interface SearchTabButtonsProps { searchType: SearchType; setSearchType: (type: SearchType) => void; t: (key: string) => string; } export const SearchTabButtons: React.FC = ({ searchType, setSearchType, t, }) => { if (Platform.OS === "ios" && !Platform.isTV) { return (