"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.DrugAutoCompleteInput = void 0;

var _preact = require("preact");

var _autoCompleteInput = require("./auto-complete-input");

var _fetchDrugAutocomplete = require("./utils/fetch-drug-autocomplete");

const DrugAutoCompleteInput = ({
  item,
  selectCallback
}) => (0, _preact.h)(_autoCompleteInput.AutoCompleteInput, {
  item: item,
  doSearch: _fetchDrugAutocomplete.fetchDrugAutocomplete,
  renderEntry: entry => entry.name + (entry.noMatch ? ' (not matched to drug ID)' : ''),
  selectCallback: selectCallback
});

exports.DrugAutoCompleteInput = DrugAutoCompleteInput;