import _mergeRight from "ramda/src/mergeRight";
import _pipe from "ramda/src/pipe";
import { useMemo } from 'react';
import { ListItem } from './ListItem';
import { Search } from './Search';
import { Action } from './Action';
import { SelectedValue } from './SelectedValue';
import { ListItem as ListItemMultiple } from './ListItemMultiple';
import { SelectedValue as SelectedValueMultiple } from './SelectedValueMultiple';
import { List } from './List';
import { ListFullScreen } from './ListFullScreen';
export var defaultComponents = {
  ListItem: ListItem,
  List: List,
  ListFullScreen: ListFullScreen,
  Search: Search,
  SelectedValue: SelectedValue,
  Action: Action
};
export var defaultComponentsMultiselect = {
  ListItem: ListItemMultiple,
  List: List,
  ListFullScreen: ListFullScreen,
  Search: Search,
  SelectedValue: SelectedValueMultiple,
  Action: Action
};
export var useComponentsWithDefaults = function useComponentsWithDefaults() {
  var components = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    multiselect: false
  };
  return useMemo(function () {
    return _pipe(_mergeRight(options.multiselect ? defaultComponentsMultiselect : defaultComponents))(components);
  }, [components, options.multiselect]);
};