diff --git a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-body.tsx b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-body.tsx index 864bc79..7694851 100644 --- a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-body.tsx +++ b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-body.tsx @@ -1,9 +1,11 @@ import { FacetItem } from "./facet-item" -import type { IntrospectionFacet } from "pinorama-types" +import type { AnySchema } from "@orama/orama" +import type { IntrospectionFacet, PinoramaIntrospection } from "pinorama-types" import type { FacetValue, SearchFilters } from "../types" type FacetBodyProps = { + introspection: PinoramaIntrospection name: string type: IntrospectionFacet values: FacetValue[] @@ -18,6 +20,7 @@ export function FacetBody(props: FacetBodyProps) { return ( name: string loading: boolean count: number @@ -14,13 +16,7 @@ type FacetHeaderProps = { } export function FacetHeader(props: FacetHeaderProps) { - const { introspection } = usePinoramaConnection() - - if (!introspection) { - return null - } - - const field = createField(props.name, introspection) + const field = createField(props.name, props.introspection) const ChevronIcon = props.open ? ChevronDown : ChevronRight return ( diff --git a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-item.tsx b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-item.tsx index a75830c..88fa63b 100644 --- a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-item.tsx +++ b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet-item.tsx @@ -1,13 +1,14 @@ import { Badge } from "@/components/ui/badge" import { Label } from "@/components/ui/label" -import { usePinoramaConnection } from "@/hooks" import { createField } from "@/lib/introspection" import { FacetFactoryInput } from "./facet-factory-input" -import type { IntrospectionFacet } from "pinorama-types" +import type { AnySchema } from "@orama/orama" +import type { IntrospectionFacet, PinoramaIntrospection } from "pinorama-types" import type { SearchFilters } from "../types" type FacetItemProps = { + introspection: PinoramaIntrospection name: string type: IntrospectionFacet value: string | number @@ -17,13 +18,7 @@ type FacetItemProps = { } export function FacetItem(props: FacetItemProps) { - const { introspection } = usePinoramaConnection() - - if (!introspection) { - return null - } - - const field = createField(props.name, introspection) + const field = createField(props.name, props.introspection) return (
diff --git a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet.tsx b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet.tsx index 5184b13..1090746 100644 --- a/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet.tsx +++ b/packages/pinorama-studio/src/features/log-explorer/components/log-filters/components/facet.tsx @@ -7,10 +7,12 @@ import { facetFilterOperationsFactory } from "../lib/operations" import { FacetBody } from "./facet-body" import { FacetHeader } from "./facet-header" -import type { IntrospectionFacet } from "pinorama-types" +import type { AnySchema } from "@orama/orama" +import type { IntrospectionFacet, PinoramaIntrospection } from "pinorama-types" import type { FacetFilter, FacetValue, SearchFilters } from "../types" type FacetProps = { + introspection: PinoramaIntrospection name: string type: IntrospectionFacet searchText: string @@ -82,6 +84,7 @@ export function Facet(props: FacetProps) { return (
) : (