File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { useVirtual } from "react-virtual";
2424import { truncate } from "lodash-es" ;
2525import { JSONHeroPath } from "@jsonhero/path" ;
2626import { useHotkeys } from "react-hotkeys-hook" ;
27+ import { useJson } from "~/hooks/useJson" ;
2728
2829export function SearchPalette ( {
2930 onSelect,
@@ -217,9 +218,11 @@ export function SearchItem({
217218 result,
218219 isHighlighted,
219220} : SearchItemProps ) {
220- const ItemIcon = iconForValue ( result . item . rawValue ) ;
221-
222221 const heroPath = new JSONHeroPath ( result . item . path ) ;
222+ const [ json ] = useJson ( ) ;
223+
224+ const itemValue = heroPath . first ( json ) ;
225+ const ItemIcon = iconForValue ( itemValue ) ;
223226
224227 const components = heroPath . components . slice ( 1 ) ;
225228
You can’t perform that action at this time.
0 commit comments