Add shared global search types

This commit is contained in:
2026-01-18 01:26:08 +00:00
parent 902253a9be
commit 925adc9712
4 changed files with 21 additions and 48 deletions

View File

@@ -2,25 +2,7 @@ import { ClockCounterClockwise, X } from '@phosphor-icons/react'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { CommandGroup, CommandItem, CommandSeparator } from '@/components/ui/command'
interface SearchHistoryItem {
id: string
query: string
timestamp: number
resultId?: string
resultTitle?: string
resultCategory?: string
}
interface SearchResult {
id: string
title: string
subtitle?: string
category: string
icon: React.ReactNode
action: () => void
tags?: string[]
}
import type { SearchHistoryItem, SearchResult } from './types'
interface RecentSearchesProps {
recentSearches: Array<{ historyItem: SearchHistoryItem; result?: SearchResult }>

View File

@@ -1,15 +1,6 @@
import { Badge } from '@/components/ui/badge'
import { CommandGroup, CommandItem, CommandSeparator } from '@/components/ui/command'
interface SearchResult {
id: string
title: string
subtitle?: string
category: string
icon: React.ReactNode
action: () => void
tags?: string[]
}
import type { SearchResult } from './types'
interface SearchResultsProps {
groupedResults: Record<string, SearchResult[]>

View File

@@ -0,0 +1,18 @@
export interface SearchResult {
id: string
title: string
subtitle?: string
category: string
icon: React.ReactNode
action: () => void
tags?: string[]
}
export interface SearchHistoryItem {
id: string
query: string
timestamp: number
resultId?: string
resultTitle?: string
resultCategory?: string
}

View File

@@ -33,25 +33,7 @@ import {
Workflow,
} from '@/types/project'
import navigationData from '@/data/global-search.json'
export interface SearchResult {
id: string
title: string
subtitle?: string
category: string
icon: React.ReactNode
action: () => void
tags?: string[]
}
export interface SearchHistoryItem {
id: string
query: string
timestamp: number
resultId?: string
resultTitle?: string
resultCategory?: string
}
import type { SearchHistoryItem, SearchResult } from './types'
const navigationIconMap = {
BookOpen,