diff --git a/frontend/src/components/TagLink.tsx b/frontend/src/components/TagLink.tsx
index a9a1c11..3ef86c8 100644
--- a/frontend/src/components/TagLink.tsx
+++ b/frontend/src/components/TagLink.tsx
@@ -91,6 +91,13 @@ export default (({ tag,
style={{ paddingLeft: `${ (nestLevel - 1) }rem` }}>
↳
)}
+ {tag.matchedAlias != null && (
+ <>
+
+ {tag.matchedAlias}
+
+ <> → >
+ >)}
{linkFlg
? (
{
}
const res = await axios.get (`${ API_BASE_URL }/tags/autocomplete`, { params: { q } })
- const data = res.data as Tag[]
+ const data = toCamel (res.data, { deep: true }) as Tag[]
setSuggestions (data)
if (suggestions.length > 0)
setSuggestionsVsbl (true)
diff --git a/frontend/src/components/TagSearchBox.tsx b/frontend/src/components/TagSearchBox.tsx
index 79c912f..cb62541 100644
--- a/frontend/src/components/TagSearchBox.tsx
+++ b/frontend/src/components/TagSearchBox.tsx
@@ -1,3 +1,4 @@
+import TagLink from '@/components/TagLink'
import { cn } from '@/lib/utils'
import type { FC } from 'react'
@@ -22,8 +23,7 @@ export default (({ suggestions, activeIndex, onSelect }: Props) => {
className={cn ('px-3 py-2 cursor-pointer hover:bg-gray-300 dark:hover:bg-gray-700',
i === activeIndex && 'bg-gray-300 dark:bg-gray-700')}
onMouseDown={() => onSelect (tag)}>
- {tag.name}
- {{tag.postCount}}
+
))}
)
}) satisfies FC
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index a2f57b7..5cf9f5d 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -44,12 +44,13 @@ export type SubMenuItem =
visible?: boolean }
export type Tag = {
- id: number
- name: string
- category: Category
- postCount: number
- hasWiki: boolean
- children?: Tag[] }
+ id: number
+ name: string
+ category: Category
+ postCount: number
+ hasWiki: boolean
+ children?: Tag[]
+ matchedAlias?: string | null }
export type User = {
id: number