11import * as Haptics from 'expo-haptics' ;
22import { useFocusEffect , useRouter } from 'expo-router' ;
3- import { Check , Search } from 'lucide-react-native' ;
3+ import { AlertTriangle , Check , Search } from 'lucide-react-native' ;
44import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
55import { Pressable , ScrollView , TextInput , View } from 'react-native' ;
66
77import { Text } from '@/components/ui/text' ;
8+ import {
9+ FREE_MODEL_DATA_LABEL ,
10+ FREE_MODEL_FREE_LABEL ,
11+ getFreeModelDataAccessibilityLabel ,
12+ isFreeModelOption ,
13+ } from '@/lib/free-model-data-disclosure' ;
814import { useThemeColors } from '@/lib/hooks/use-theme-colors' ;
915import { type ModelOption , thinkingEffortLabel } from '@/lib/hooks/use-available-models' ;
1016import { clearModelPickerBridge , getModelPickerBridge } from '@/lib/picker-bridge' ;
@@ -217,6 +223,8 @@ export default function ModelPickerScreen() {
217223
218224 const modelOption = item . model ;
219225 const selected = modelOption . id === selectedModel ;
226+ const free = isFreeModelOption ( modelOption ) ;
227+ const collectsData = isFreeModelOption ( modelOption ) ;
220228 const hasVariants = modelOption . variants . length > 1 ;
221229
222230 return (
@@ -227,11 +235,30 @@ export default function ModelPickerScreen() {
227235 handleSelectModel ( modelOption . id ) ;
228236 } }
229237 accessibilityRole = "button"
230- accessibilityLabel = { `${ modelOption . name } ${ selected ? ', selected' : '' } ` }
238+ accessibilityLabel = { `${ collectsData ? getFreeModelDataAccessibilityLabel ( modelOption . name ) : modelOption . name } ${ selected ? ', selected' : '' } ` }
231239 >
232240 < View className = "flex-1" >
233241 < Text className = "text-base text-foreground" > { modelOption . name } </ Text >
234242 < Text className = "text-xs text-muted-foreground" > { modelOption . id } </ Text >
243+ { free ? (
244+ < View className = "mt-1 flex-row items-center gap-1 self-start" >
245+ < View
246+ className = "rounded-full px-2 py-0.5"
247+ style = { { backgroundColor : colors . good } }
248+ >
249+ < Text className = "text-[11px] font-medium text-white" numberOfLines = { 1 } >
250+ { FREE_MODEL_FREE_LABEL }
251+ </ Text >
252+ </ View >
253+ { collectsData ? (
254+ < AlertTriangle
255+ accessibilityLabel = { FREE_MODEL_DATA_LABEL }
256+ size = { 13 }
257+ color = { colors . warn }
258+ />
259+ ) : null }
260+ </ View >
261+ ) : null }
235262 </ View >
236263 { selected && < Check size = { 18 } color = { colors . primary } /> }
237264 </ Pressable >
0 commit comments