import * as SelectPrimitive from '@rn-primitives/select'; import * as React from 'react'; import { Platform, StyleSheet, View } from 'react-native'; import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'; import { Check } from '@/lib/icons/Check'; import { ChevronDown } from '@/lib/icons/ChevronDown'; import { ChevronUp } from '@/lib/icons/ChevronUp'; import { cn } from '@/lib/utils'; type Option = SelectPrimitive.Option; const Select = SelectPrimitive.Root; const SelectGroup = SelectPrimitive.Group; const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef( ({ className, children, ...props }, ref) => ( span]:line-clamp-1', props.disabled && 'web:cursor-not-allowed opacity-50', className )} {...props} > <>{children} ) ); SelectTrigger.displayName = SelectPrimitive.Trigger.displayName; /** * Platform: WEB ONLY */ const SelectScrollUpButton = ({ className, ...props }: SelectPrimitive.ScrollUpButtonProps) => { if (Platform.OS !== 'web') { return null; } return ( ); }; /** * Platform: WEB ONLY */ const SelectScrollDownButton = ({ className, ...props }: SelectPrimitive.ScrollDownButtonProps) => { if (Platform.OS !== 'web') { return null; } return ( ); }; const SelectContent = React.forwardRef< SelectPrimitive.ContentRef, SelectPrimitive.ContentProps & { portalHost?: string } >(({ className, children, position = 'popper', portalHost, ...props }, ref) => { const { open } = SelectPrimitive.useRootContext(); return ( {children} ); }); SelectContent.displayName = SelectPrimitive.Content.displayName; const SelectLabel = React.forwardRef( ({ className, ...props }, ref) => ( ) ); SelectLabel.displayName = SelectPrimitive.Label.displayName; const SelectItem = React.forwardRef( ({ className, children, ...props }, ref) => ( ) ); SelectItem.displayName = SelectPrimitive.Item.displayName; const SelectSeparator = React.forwardRef< SelectPrimitive.SeparatorRef, SelectPrimitive.SeparatorProps >(({ className, ...props }, ref) => ( )); SelectSeparator.displayName = SelectPrimitive.Separator.displayName; export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type Option, };