From 54cf8811af626df63b1b093561bd0337d1f786eb Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 6 Oct 2025 11:18:51 +0300 Subject: [PATCH] docs: show badge for community integrations (#13691) --- .../src/components/Search/Hits/index.tsx | 100 ++++++++++-------- 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/www/packages/docs-ui/src/components/Search/Hits/index.tsx b/www/packages/docs-ui/src/components/Search/Hits/index.tsx index 898399a3c2..f7a1348720 100644 --- a/www/packages/docs-ui/src/components/Search/Hits/index.tsx +++ b/www/packages/docs-ui/src/components/Search/Hits/index.tsx @@ -12,7 +12,7 @@ import { } from "react-instantsearch" import { SearchNoResult } from "../NoResults" import { useSearch } from "@/providers" -import { Link, SearchHitGroupName } from "@/components" +import { Badge, Link, SearchHitGroupName } from "@/components" export type Hierarchy = "lvl0" | "lvl1" | "lvl2" | "lvl3" | "lvl4" | "lvl5" @@ -34,6 +34,7 @@ export type HitType = { __queryID?: string objectID: string description?: string + integration_vendor?: string } export type GroupedHitType = { @@ -157,14 +158,14 @@ export const SearchHits = ({ .join(" › ") return (
{ @@ -174,49 +175,62 @@ export const SearchHits = ({ } }} > - - {/* @ts-expect-error React v19 doesn't see this type as a React element */} - - - - {item.type === "content" && ( - <> - {/* @ts-expect-error React v19 doesn't see this type as a React element */} - - - )} - {item.type !== "content" && item.description} - + + {/* @ts-expect-error React v19 doesn't see this type as a React element */} + + + + {item.type === "content" && ( + <> + {/* @ts-expect-error React v19 doesn't see this type as a React element */} + + + )} + {item.type !== "content" && item.description} + - + {hierarchies} + + { + sendEvent("click", item, "Search Result Clicked") + if (checkIfInternal(item.url)) { + e.preventDefault() + window.location.href = item.url + setIsOpen(false) + } + }} + /> +
+ {!!item.integration_vendor && + item.integration_vendor !== "Medusa" && ( + + Community + )} - > - {hierarchies} - - { - sendEvent("click", item, "Search Result Clicked") - if (checkIfInternal(item.url)) { - e.preventDefault() - window.location.href = item.url - setIsOpen(false) - } - }} - /> ) })}