var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import React from 'react';
import PropTypes from 'prop-types';

import InputText from '../../forms/InputText';
import ButtonWithIcon from '../../atoms/buttons/ButtonWithIcon';

import './style.css';

var SearchBannerForm = function SearchBannerForm(searchBannerForm) {
  var _searchBannerForm$but = searchBannerForm.buttonSearch.classes,
      classes = _searchBannerForm$but === undefined ? [] : _searchBannerForm$but;

  classes = classes.concat(['ma__search-banner__button']);

  return React.createElement(
    'form',
    { className: 'ma__search-banner__form', action: searchBannerForm.action, onSubmit: searchBannerForm.onSubmit },
    React.createElement(
      'div',
      { className: 'ma__search-banner__input' },
      React.createElement(InputText, searchBannerForm.inputText)
    ),
    React.createElement(ButtonWithIcon, _extends({}, searchBannerForm.buttonSearch, { classes: classes }))
  );
};

SearchBannerForm.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The URL to submit form data to */
  action: PropTypes.string,
  /** Custom submit function */
  onSubmit: PropTypes.func,
  /** The properties for the text input field */
  inputText: PropTypes.shape(InputText.propTypes).isRequired,
  /** The Search button */
  buttonSearch: PropTypes.shape(ButtonWithIcon.propTypes).isRequired
} : {};

export default SearchBannerForm;