Remove graphSearchTypes.ts, move OptionItem type to GraphSearch.tsx
This commit is contained in:
@@ -111,7 +111,7 @@ const GraphLabels = () => {
|
||||
// Clear current graph data to ensure complete reload when label changes
|
||||
if (newLabel !== currentLabel) {
|
||||
const graphStore = useGraphStore.getState();
|
||||
// 完全重置图形状态
|
||||
// Reset the all graph objects and status
|
||||
graphStore.reset();
|
||||
}
|
||||
|
||||
|
@@ -10,11 +10,17 @@ import { searchResultLimit } from '@/lib/constants'
|
||||
import { useGraphStore } from '@/stores/graph'
|
||||
import MiniSearch from 'minisearch'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { OptionItem } from './graphSearchTypes'
|
||||
|
||||
// Message item identifier for search results
|
||||
export const messageId = '__message_item'
|
||||
|
||||
// Search result option item interface
|
||||
export interface OptionItem {
|
||||
id: string
|
||||
type: 'nodes' | 'edges' | 'message'
|
||||
message?: string
|
||||
}
|
||||
|
||||
const NodeOption = ({ id }: { id: string }) => {
|
||||
const graph = useGraphStore.use.sigmaGraph()
|
||||
if (!graph?.hasNode(id)) {
|
||||
|
@@ -1,5 +0,0 @@
|
||||
export interface OptionItem {
|
||||
id: string
|
||||
type: 'nodes' | 'edges' | 'message'
|
||||
message?: string
|
||||
}
|
Reference in New Issue
Block a user