import { type PropsWithChildren } from "react"; import { FilterSchemaProvider, type FilterSchemaContext, } from "./hooks/use-filter-schema-context.js"; import { FilterThemeProvider, useOptionalFilterTheme, } from "./theme/context.js"; import { presetTheme } from "./theme/preset.js"; import type { FilterTheme } from "./theme/types.js"; export interface FilterSphereProviderProps { context: FilterSchemaContext; theme?: FilterTheme; } export const FilterSphereProvider = ({ theme, context, children, }: PropsWithChildren>) => { const inheritedTheme = useOptionalFilterTheme(); const resolvedTheme = theme ?? inheritedTheme ?? presetTheme; return ( {children} ); };