|
1
|
import clsx from "clsx" |
|
2
|
import React from "react" |
|
3
|
|
|
4
|
export type SearchSuggestionItemType = { |
|
5
|
onClick: () => void |
|
6
|
} & React.AllHTMLAttributes<HTMLDivElement> |
|
7
|
|
|
8
|
export const SearchSuggestionItem = ({ |
|
9
|
children, |
|
10
|
onClick, |
|
11
|
className, |
|
12
|
...rest |
|
13
|
}: SearchSuggestionItemType) => { |
|
14
|
return ( |
|
15
|
<div |
|
16
|
className={clsx( |
|
17
|
"flex items-center justify-between gap-docs_0.75", |
|
18
|
"cursor-pointer rounded-docs_sm p-docs_0.5", |
|
19
|
"hover:bg-medusa-bg-base-hover", |
|
20
|
"focus:bg-medusa-bg-base-hover", |
|
21
|
"focus:outline-none last:mb-docs_1", |
|
22
|
"text-medusa-fg-base text-compact-small", |
|
23
|
className |
|
24
|
)} |
|
25
|
onClick={onClick} |
|
26
|
data-hit |
|
27
|
{...rest} |
|
28
|
> |
|
29
|
{children} |
|
30
|
</div> |
|
31
|
) |
|
32
|
} |