import { createContext, useContext } from 'react';

var FilterTypeContext = /*#__PURE__*/createContext([]);
function useFilterTypes() {
  return useContext(FilterTypeContext);
}

var byType = function byType(type) {
  return function (filterType) {
    return filterType.type === type;
  };
};

function useFilterType(type) {
  var filterTypes = useFilterTypes();
  return filterTypes.find(byType(type)).filter;
}

export { FilterTypeContext as default, useFilterType, useFilterTypes };
