import { View, Text, TouchableOpacity, StyleSheet } from "react-native"; import { gameUIColors } from "../gameUI"; export interface Tab { key: string; label: string; } interface TabSelectorProps { tabs: Tab[]; activeTab: string; onTabChange: (tab: string) => void; } export function TabSelector({ tabs, activeTab, onTabChange, }: TabSelectorProps) { return ( {tabs.map((tab) => ( onTabChange(tab.key)} style={[ styles.tabButton, activeTab === tab.key ? styles.tabButtonActive : styles.tabButtonInactive, ]} > {tab.label} ))} ); } const styles = StyleSheet.create({ container: { flexDirection: "row", backgroundColor: gameUIColors.panel, borderRadius: 6, padding: 2, borderWidth: 1, borderColor: gameUIColors.border + "40", justifyContent: "space-evenly", height: 28, }, tabButton: { paddingHorizontal: 8, paddingVertical: 3, borderRadius: 4, alignItems: "center", justifyContent: "center", flex: 1, marginHorizontal: 1, }, tabButtonActive: { backgroundColor: gameUIColors.info + "20", borderWidth: 1, borderColor: gameUIColors.info + "40", }, tabButtonInactive: { backgroundColor: "transparent", }, tabButtonText: { fontSize: 12, fontWeight: "600", letterSpacing: 0.5, fontFamily: "monospace", textTransform: "uppercase", }, tabButtonTextActive: { color: gameUIColors.info, }, tabButtonTextInactive: { color: gameUIColors.muted, }, });