+
Selected person: {selectedPerson?.name ?? "N/A"}
+
0 ? filtered : [emptyOption.current],
+ disabled: (option) => option.disabled || option.empty,
+ }}
+ value={selectedPerson}
+ nullable
+ onChange={(value) => {
+ setSelectedPerson(value)
+ setQuery('')
+ }}
+ as="div"
+ >
+
+ Person
+
+
+
+
+ setQuery(e.target.value)}
+ displayValue={(option: Option | null) => option?.name ?? ''}
+ className="border-none px-3 py-1 outline-none"
+ />
+
+
+
+
+
+
+
+
+
+ {
+ ({ option }: { option: Option }) => {
+ if (option.empty) {
+ return (
+
+
+
+
+
No people found
+
+
+
+ )
+ }
+
+ return (
+ {
+ return classNames(
+ 'relative w-full cursor-default select-none py-2 pl-3 pr-9 focus:outline-none',
+ active ? 'bg-indigo-600 text-white' : 'text-gray-900'
+ )
+ }}
+ >
+
+ {option.name}
+
+
+ )
+ }
+ }
+
+
+
+
+
+ )
+}