diff --git a/src/components/SearchPanel.tsx b/src/components/SearchPanel.tsx index 10c9e69e..2d7f166d 100644 --- a/src/components/SearchPanel.tsx +++ b/src/components/SearchPanel.tsx @@ -1,11 +1,11 @@ import { useRef, useEffect, useCallback } from 'react' import { useMemo } from 'react' import { cn } from '@/lib/utils' -import { Badge } from '@/components/ui/badge' import type { SearchResult, VaultEntry } from '../types' import { useUnifiedSearch } from '../hooks/useUnifiedSearch' -import { getTypeColor, getTypeLightColor, buildTypeEntryMap } from '../utils/typeColors' +import { getTypeColor, buildTypeEntryMap } from '../utils/typeColors' import { formatSearchSubtitle } from '../utils/noteListHelpers' +import { getTypeIcon } from './NoteItem' interface SearchPanelProps { open: boolean @@ -194,8 +194,9 @@ function SearchContent({ const entry = entryLookup.get(result.path) const isA = entry?.isA ?? result.noteType const noteType = isA && isA !== 'Note' ? isA : null - const typeColor = noteType ? getTypeColor(isA, typeEntryMap[isA ?? '']?.color) : undefined - const typeLightColor = noteType ? getTypeLightColor(isA, typeEntryMap[isA ?? '']?.color) : undefined + const te = typeEntryMap[isA ?? ''] + const typeColor = noteType ? getTypeColor(isA, te?.color) : undefined + const TypeIcon = getTypeIcon(isA ?? null, te?.icon) const subtitle = entry ? formatSearchSubtitle(entry) : null return (
+
{subtitle}
)}