Added greyed out suggestions to search bar.
This commit is contained in:
parent
0950ed9e5c
commit
d75c361603
@ -231,14 +231,17 @@ export default function Search({ options }) {
|
|||||||
{searchSuggestions[1].map((suggestion) => (
|
{searchSuggestions[1].map((suggestion) => (
|
||||||
<Combobox.Option key={suggestion} value={suggestion} className="flex w-full">
|
<Combobox.Option key={suggestion} value={suggestion} className="flex w-full">
|
||||||
{({ active }) => (
|
{({ active }) => (
|
||||||
<span
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"px-2 py-1 rounded-md w-full",
|
"px-2 py-1 rounded-md w-full",
|
||||||
active ? "bg-theme-300/20 dark:bg-white/10" : "",
|
active ? "bg-theme-300/20 dark:bg-white/10" : "",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{suggestion}
|
<span className="whitespace-pre">{suggestion.indexOf(query) === 0 ? query : ""}</span>
|
||||||
</span>
|
<span className="mr-4 whitespace-pre opacity-50">
|
||||||
|
{suggestion.indexOf(query) === 0 ? suggestion.substring(query.length) : suggestion}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</Combobox.Option>
|
</Combobox.Option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user