import { Filter } from '@wix/bex-core';
import { createContext } from '../createContext';
import { useContext } from 'react';

const { Provider, Consumer, Context } = createContext<Filter<any>>(
  'FilterContextProvider',
);

export const FilterContext = Context;
export const FilterContextProvider = Provider;
export const FilterContextConsumer = Consumer;
export const useFilterContext = <F>() => useContext(FilterContext) as Filter<F>;
