2022-11-01 03:06:25 +00:00
|
|
|
import {useTheme} from 'react-native-paper'
|
2022-11-15 06:51:15 +00:00
|
|
|
import RNPickerSelect from 'react-native-picker-select'
|
|
|
|
import {Item} from 'react-native-picker-select'
|
2022-11-01 03:06:25 +00:00
|
|
|
|
|
|
|
export default function Select({
|
|
|
|
value,
|
|
|
|
onChange,
|
2022-11-15 06:51:15 +00:00
|
|
|
items,
|
2022-11-01 03:06:25 +00:00
|
|
|
}: {
|
|
|
|
value: string
|
|
|
|
onChange: (value: string) => void
|
2022-11-15 06:51:15 +00:00
|
|
|
items: Item[]
|
2022-11-01 03:06:25 +00:00
|
|
|
}) {
|
|
|
|
const {colors} = useTheme()
|
|
|
|
|
|
|
|
return (
|
2022-11-15 06:51:15 +00:00
|
|
|
<RNPickerSelect
|
|
|
|
style={{
|
|
|
|
placeholder: {
|
2022-11-16 01:32:47 +00:00
|
|
|
color: colors.primary,
|
2022-11-15 06:51:15 +00:00
|
|
|
},
|
|
|
|
}}
|
|
|
|
value={value}
|
2022-11-16 01:32:47 +00:00
|
|
|
placeholder={{label: 'Select...'}}
|
2022-11-15 06:51:15 +00:00
|
|
|
onValueChange={onChange}
|
|
|
|
items={items}
|
|
|
|
/>
|
2022-11-01 03:06:25 +00:00
|
|
|
)
|
|
|
|
}
|