11import { useCallback , useContext , useEffect , useMemo , useState } from "react"
22import { RelationsGraphContext } from "@/components/graph/RelationsGraphContext"
33import { ReactSearchComponentContext } from "@/components/ReactSearchComponentContext"
4- import { useStore } from "zustand/index "
4+ import { useStore } from "zustand"
55import { resultCache } from "@/lib/ResultCache"
66import { DateTime } from "luxon"
77import { ChevronDown , Download , GitFork , LoaderCircle , Microscope , Pencil , PlusIcon , SearchIcon , TableProperties } from "lucide-react"
@@ -10,7 +10,7 @@ import { Button } from "@/components/ui/button"
1010import { DropdownMenu , DropdownMenuContent , DropdownMenuItem , DropdownMenuSeparator , DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
1111import { SearchFieldConfiguration } from "@elastic/search-ui"
1212import { GenericResultViewTag , GenericResultViewTagProps } from "@/components/result/GenericResultViewTag"
13- import { z } from "zod"
13+ import * as z from "zod/mini "
1414import { GenericResultViewImage } from "@/components/result/GenericResultViewImage"
1515import { GraphNodeUtils } from "@/components/graph/GraphNodeUtils"
1616import { Dialog , DialogContent , DialogTitle } from "@/components/ui/dialog"
@@ -143,12 +143,7 @@ export function GenericResultView({
143143 ( field : string ) => {
144144 try {
145145 const value = autoUnwrap (
146- z
147- . string ( )
148- . or ( z . number ( ) )
149- . or ( z . object ( { raw : z . string ( ) . or ( z . number ( ) ) } ) )
150- . optional ( )
151- . parse ( result [ field ] )
146+ z . optional ( z . union ( [ z . string ( ) , z . number ( ) , z . object ( { raw : z . union ( [ z . string ( ) , z . number ( ) ] ) } ) ] ) ) . parse ( result [ field ] )
152147 )
153148
154149 return value ? value + "" : undefined
@@ -165,12 +160,14 @@ export function GenericResultView({
165160 try {
166161 const value = autoUnwrapArray < string | number > (
167162 z
168- . string ( )
169- . array ( )
170- . or ( z . number ( ) . array ( ) )
171- . or ( z . object ( { raw : z . string ( ) . array ( ) } ) )
172- . or ( z . object ( { raw : z . number ( ) . array ( ) } ) )
173- . optional ( )
163+ . optional (
164+ z . union ( [
165+ z . array ( z . string ( ) ) ,
166+ z . array ( z . number ( ) ) ,
167+ z . object ( { raw : z . array ( z . number ( ) ) } ) ,
168+ z . object ( { raw : z . array ( z . string ( ) ) } )
169+ ] )
170+ )
174171 . parse ( result [ field ] )
175172 )
176173 return value ? value . map ( ( v ) => v + "" ) : [ ]
0 commit comments