Added greyed out suggestions to search bar.

pull/2775/head
Flo2410 4 months ago
parent 0950ed9e5c
commit d75c361603
No known key found for this signature in database
GPG Key ID: 8ECB00AC5216DC7F

@ -231,14 +231,17 @@ export default function Search({ options }) {
{searchSuggestions[1].map((suggestion) => (
<Combobox.Option key={suggestion} value={suggestion} className="flex w-full">
{({ active }) => (
<span
<div
className={classNames(
"px-2 py-1 rounded-md w-full",
active ? "bg-theme-300/20 dark:bg-white/10" : "",
)}
>
{suggestion}
</span>
<span className="whitespace-pre">{suggestion.indexOf(query) === 0 ? query : ""}</span>
<span className="mr-4 whitespace-pre opacity-50">
{suggestion.indexOf(query) === 0 ? suggestion.substring(query.length) : suggestion}
</span>
</div>
)}
</Combobox.Option>
))}

Loading…
Cancel
Save