1import React from 'react';
2import { useSelect } from 'react-select-search';
3
4const CustomSelect = ({ options, value, multiple, disabled }) => {
5 const [snapshot, valueProps, optionProps] = useSelect({
6 options,
7 value,
8 multiple,
9 disabled,
10 });
11
12 return (
13 <div>
14 <button {...valueProps}>{snapshot.displayValue}</button>
15 {snapshot.focus && (
16 <ul>
17 {snapshot.options.map((option) => (
18 <li key={option.value}>
19 <button {...optionProps} value={option.value}>{option.name}</button>
20 </li>
21 ))}
22 </ul>
23 )}
24 </div>
25 );
26};