import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' import type { FloorNumber } from '@repo/types' const FLOORS: FloorNumber[] = [1, 2, 3, 4] const FLOOR_LABEL: Record = { 1: '1F', 2: '2F', 3: '3F', 4: '楼顶' } interface FloorTabsProps { currentFloor: FloorNumber onChange: (floor: FloorNumber) => void } export function FloorTabs({ currentFloor, onChange }: FloorTabsProps) { return ( {FLOORS.map((floor) => { const active = floor === currentFloor return ( onChange(floor)} activeOpacity={0.7} > {FLOOR_LABEL[floor]} ) })} ) } const styles = StyleSheet.create({ container: { flexDirection: 'row', backgroundColor: '#F9FAFB', borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: '#E5E7EB', }, tab: { flex: 1, alignItems: 'center', paddingVertical: 10, }, activeTab: { borderBottomWidth: 2, borderBottomColor: '#10B981', }, label: { fontSize: 14, fontWeight: '500', color: '#6B7280', }, activeLabel: { color: '#10B981', fontWeight: '700', }, })