import React, { useState, useCallback } from 'react'; import { StyleSheet } from 'react-native'; import { Select, SelectElement, SelectProps, SelectItem, SelectGroup, } from '@ui-kitten/components'; import { SelectOptionType } from './type'; interface SelectCustomProps extends SelectProps { data: SelectOptionType[]; multiSelect?: boolean; groupedOptions?: boolean; } export const SelectShowcase = (props: SelectCustomProps): SelectElement => { const [selectedIndex, setSelectedIndex] = useState(props.selectedIndex); const renderOption = useCallback( (item, index) => , [] ); const renderGroup = useCallback( (item, index) => ( {item.items.map(renderOption)} ), [] ); const displayValue = () => props.groupedOptions ? props.data[selectedIndex.section].items[selectedIndex.row].title : props.data[selectedIndex.row].title; return ( <> ); }; const styles = StyleSheet.create({ select: { width: 200, }, });