diff --git a/src/components/Hack/HackSubmitForm.tsx b/src/components/Hack/HackSubmitForm.tsx index 5bf7705..bfea841 100644 --- a/src/components/Hack/HackSubmitForm.tsx +++ b/src/components/Hack/HackSubmitForm.tsx @@ -774,6 +774,7 @@ export default function HackSubmitForm({ {!isDummy ? ( } + + + {(() => { + const displayItems = filterOptions(query); + + if (displayItems.length === 0) { + return ( +
No results found
+ ); + } + + return displayItems.map((item, index) => { + if ("type" in item && item.type === "divider") { + return ; + } + + const option = item as SelectOption; + const Icon = option.icon; + return ( + + `relative cursor-pointer select-none py-2 pl-10 pr-4 ${ + focus ? "bg-black/5 dark:bg-white/10" : "" + } ${option.disabled ? "opacity-50 cursor-not-allowed" : ""}` + } + > + {({ selected }) => ( + <> + + {Icon && } + {option.label} + {option.description && ( + + {option.description} + + )} + + {selected && ( + + + )} + + )} + + ); + }); + })()} +
+
+ + )} + + ); + } + + // Use Listbox for non-filterable select return ( {({ open }) => ( @@ -61,7 +194,12 @@ export default function Select({ leaveTo="opacity-0" > - {options.map((option) => { + {options.map((item, index) => { + if ("type" in item && item.type === "divider") { + return ; + } + + const option = item as SelectOption; const Icon = option.icon; return ( {({ selected }) => ( <> - + {Icon && } - {option.label} + {option.label} + {option.description && ( + + {option.description} + + )} {selected && (