docs: show badge for community integrations (#13691)
This commit is contained in:
1 parent
62d340b897
commit
54cf8811af
1 file changed
+19
-5
@@ -12,7 +12,7 @@ import {
|
|||||||
} from "react-instantsearch"
|
} from "react-instantsearch"
|
||||||
import { SearchNoResult } from "../NoResults"
|
import { SearchNoResult } from "../NoResults"
|
||||||
import { useSearch } from "@/providers"
|
import { useSearch } from "@/providers"
|
||||||
import { Link, SearchHitGroupName } from "@/components"
|
import { Badge, Link, SearchHitGroupName } from "@/components"
|
||||||
|
|
||||||
export type Hierarchy = "lvl0" | "lvl1" | "lvl2" | "lvl3" | "lvl4" | "lvl5"
|
export type Hierarchy = "lvl0" | "lvl1" | "lvl2" | "lvl3" | "lvl4" | "lvl5"
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ export type HitType = {
|
|||||||
__queryID?: string
|
__queryID?: string
|
||||||
objectID: string
|
objectID: string
|
||||||
description?: string
|
description?: string
|
||||||
|
integration_vendor?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GroupedHitType = {
|
export type GroupedHitType = {
|
||||||
@@ -157,14 +158,14 @@ export const SearchHits = ({
|
|||||||
.join(" › ")
|
.join(" › ")
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
key={index}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"gap-docs_0.25 relative flex flex-1 flex-col p-docs_0.5",
|
"p-docs_0.5",
|
||||||
"overflow-x-hidden text-ellipsis whitespace-nowrap break-words",
|
|
||||||
"hover:bg-medusa-bg-base-hover",
|
"hover:bg-medusa-bg-base-hover",
|
||||||
"focus:bg-medusa-bg-base-hover",
|
"focus:bg-medusa-bg-base-hover",
|
||||||
"focus:outline-none"
|
"focus:outline-none",
|
||||||
|
"flex justify-between items-center"
|
||||||
)}
|
)}
|
||||||
key={index}
|
|
||||||
tabIndex={index}
|
tabIndex={index}
|
||||||
data-hit
|
data-hit
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
@@ -173,6 +174,12 @@ export const SearchHits = ({
|
|||||||
target.querySelector("a")?.click()
|
target.querySelector("a")?.click()
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={clsx(
|
||||||
|
"gap-docs_0.25 relative flex flex-1 flex-col",
|
||||||
|
"overflow-x-hidden text-ellipsis whitespace-nowrap break-words"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@@ -218,6 +225,13 @@ export const SearchHits = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{!!item.integration_vendor &&
|
||||||
|
item.integration_vendor !== "Medusa" && (
|
||||||
|
<Badge variant="blue" badgeType="shaded">
|
||||||
|
Community
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user