/**
 *
 * PageFooter
 *
 */

import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import { get } from 'lodash';
import { FormattedMessage } from 'react-intl';

import GlobalPagination from 'components/GlobalPagination';
import InputSelect from 'components/InputSelect';

import styles from './styles.scss';

function PageFooter(props) {
  return (
    <div className={cn('row', styles.pageFooter)}>
      <div className="col-md-6 col-lg-6">
        <form className="form-inline">
          <div className={styles.pageFooterSelectWrapper}>
            <select
              className={`form-control ${styles.select}`}
              id="params.limit"
              name="params.limit"
              onChange={(e) => {
                const target = {
                  name: 'params.limit',
                  value: parseInt(e.target.value, 10),
                };
                props.onChangeParams({ target });
              }}
              value={get(props, ['params', 'limit'], 10)}
            >
              {[10, 20, 50, 100].map((value, key) => <option value={value} key={value}>{value}</option>)}
            </select>
          </div>
          <label className={styles.pageFooterLabel} htmlFor="params.limit">
            <FormattedMessage id="components.PageFooter.select" />
          </label>
        </form>
      </div>
      <div className="col-md-6 col-lg-6">
        <GlobalPagination
          count={props.count}
          onChangeParams={props.onChangeParams}
          params={props.params}
        />
      </div>
    </div>
  );
}

PageFooter.defaultProps = {};

PageFooter.propTypes = {};

export default PageFooter;

@@ -1622,36 +1622,219 @@
  = %7B
-%7D;%0A%0APageFooter.propTypes = %7B
+%0A  count: 1,%0A  onChangeParams: () =%3E %7B%7D,%0A  params: %7B%0A    currentPage: 1,%0A    limit: 10,%0A  %7D,%0A%7D;%0A%0APageFooter.propTypes = %7B%0A  count: PropTypes.number,%0A  onChangeParams: PropTypes.func,%0A  params: PropTypes.object,%0A
 %7D;%0A%0A

Add default Props to Pagefooter