import { View, Text, Pressable, StyleSheet } from 'react-native' import { Check } from 'lucide-react-native' import { colors, spacing, typography } from '../theme/mobile-theme' import { BottomDrawer } from './BottomDrawer' export type PickerOption = { value: T label: string subtitle?: string } type Props = { visible: boolean title: string options: PickerOption[] selected: T onSelect: (value: T) => void onClose: () => void } export function PickerModal({ visible, title, options, selected, onSelect, onClose }: Props) { return ( {title} {options.map((opt, i) => { const isSelected = opt.value === selected return ( {i > 0 && } [styles.row, pressed && styles.rowPressed]} onPress={() => { onSelect(opt.value) onClose() }} > {opt.label} {opt.subtitle ? {opt.subtitle} : null} {isSelected && } ) })} ) } const styles = StyleSheet.create({ header: { paddingHorizontal: spacing.xs, paddingBottom: spacing.sm }, title: { fontSize: 13, fontWeight: '500', color: colors.textMuted }, group: { backgroundColor: colors.bgPanel, borderRadius: 12, overflow: 'hidden' }, separator: { height: StyleSheet.hairlineWidth, backgroundColor: colors.borderSubtle, marginHorizontal: spacing.md }, row: { flexDirection: 'row', alignItems: 'center', paddingVertical: spacing.md, paddingHorizontal: spacing.md + 2 }, rowPressed: { backgroundColor: colors.bgRaised }, rowContent: { flex: 1 }, rowLabel: { fontSize: typography.bodySize, color: colors.textPrimary }, rowLabelSelected: { fontWeight: '600' }, rowSubtitle: { fontSize: 11, color: colors.textMuted, marginTop: 1 } })