import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["value", "setValue", "placeholder", "children"];
import React from "react";
import PropTypes from "prop-types";
import createComponent from "../../system/createComponent";
import TextField from "../../next/TextField";
import Menu from "../../next/Menu";
import MenuItem from "../../next/Menu/MenuItem";
var Autocomplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var value = props.value,
      setValue = props.setValue,
      placeholder = props.placeholder,
      children = props.children,
      otherProps = _objectWithoutProperties(props, _excluded);

  var top10Films = [{
    title: "The Shawshank Redemption",
    year: 1994
  }, {
    title: "The Godfather",
    year: 1972
  }, {
    title: "The Godfather: Part II",
    year: 1974
  }, {
    title: "The Dark Knight",
    year: 2008
  }, {
    title: "12 Angry Men",
    year: 1957
  }];

  var handleItemSelect = function handleItemSelect(val) {
    setValue(val);
  };

  return /*#__PURE__*/React.createElement(Menu, _extends({
    trigger: /*#__PURE__*/React.createElement(TextField, {
      name: "period",
      size: "small",
      placeholder: placeholder,
      value: value,
      onChange: setValue,
      options: [] //className={classes.select}

    }),
    ref: ref
  }, otherProps), top10Films.map(function (film) {
    return /*#__PURE__*/React.createElement(MenuItem, {
      key: film.title,
      onClick: function onClick() {
        return handleItemSelect(film.title);
      }
    }, film.title);
  }));
});
Autocomplete.propTypes = {
  value: PropTypes.string,
  setValue: PropTypes.func
};
Autocomplete.defaultProps = {// modal: false,
};

if (process.env.NODE_ENV !== "production") {
  Autocomplete.displayName = "LabAutocomplete";
}

var StyledAutocomplete = createComponent(Autocomplete);
export default StyledAutocomplete;