import React from 'react' import type { PropsWithChildren } from 'react' import { createContext } from 'react' export interface SearchProviderContextValue { /** * Term to be researched. */ term: string /** * Enables a loading state. */ isLoading: boolean /** * List of Suggestion terms. */ terms: Array<{ value: string }> /** * List of Suggested products. */ products: {}[] /** * Callback function when a search term is selected. */ onSearchSelection?: (term: string, path: string) => void /** * Search result searchId. */ searchId?: string } export const SearchContext = createContext( null ) function SearchProvider({ onSearchSelection, children, term, terms, products, isLoading, searchId, }: PropsWithChildren) { return ( {children} ) } export default SearchProvider