'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Button = require('@material-ui/core/Button');

var _Button2 = _interopRequireDefault(_Button);

var _Dialog = require('@material-ui/core/Dialog');

var _Dialog2 = _interopRequireDefault(_Dialog);

var _DialogActions = require('@material-ui/core/DialogActions');

var _DialogActions2 = _interopRequireDefault(_DialogActions);

var _DialogContent = require('@material-ui/core/DialogContent');

var _DialogContent2 = _interopRequireDefault(_DialogContent);

var _DialogTitle = require('@material-ui/core/DialogTitle');

var _DialogTitle2 = _interopRequireDefault(_DialogTitle);

var _InputLabel = require('@material-ui/core/InputLabel');

var _InputLabel2 = _interopRequireDefault(_InputLabel);

var _Input = require('@material-ui/core/Input');

var _Input2 = _interopRequireDefault(_Input);

var _FormControl = require('@material-ui/core/FormControl');

var _FormControl2 = _interopRequireDefault(_FormControl);

var _Select = require('@material-ui/core/Select');

var _Select2 = _interopRequireDefault(_Select);

var _reactIntl = require('react-intl');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var messages = (0, _reactIntl.defineMessages)({
  title: {
    'id': 'printDialog.title',
    'defaultMessage': 'Print settings'
  },
  paperSize: {
    'id': 'printDialog.paperSizeLabel',
    'defaultMessage': 'Paper size'
  },
  cancel: {
    'id': 'printDialog.cancelButtonLabel',
    'defaultMessage': 'Cancel'
  },
  print: {
    'id': 'printDialog.printButtonLabel',
    'defaultMessage': 'Print'
  }
});

var PrintDialog = function PrintDialog(_ref) {
  var open = _ref.open,
      onClose = _ref.onClose,
      onChangePaperSize = _ref.onChangePaperSize,
      paperSize = _ref.paperSize;
  return _react2.default.createElement(
    _Dialog2.default,
    { open: open, onClose: onClose, fullWidth: true, maxWidth: 'xs', className: 'd-print-none' },
    _react2.default.createElement(
      _DialogTitle2.default,
      null,
      _react2.default.createElement(_reactIntl.FormattedMessage, messages.title)
    ),
    _react2.default.createElement(
      _DialogContent2.default,
      null,
      _react2.default.createElement(
        _FormControl2.default,
        null,
        _react2.default.createElement(
          _InputLabel2.default,
          { htmlFor: 'paper-size' },
          _react2.default.createElement(_reactIntl.FormattedMessage, messages.paperSize)
        ),
        _react2.default.createElement(
          _Select2.default,
          {
            native: true,
            value: paperSize,
            onChange: function onChange(e) {
              return onChangePaperSize(e.target.value);
            },
            input: _react2.default.createElement(_Input2.default, { id: 'paper-size' })
          },
          _react2.default.createElement(
            'option',
            { value: 'a4' },
            'A4 (210mm x 297mm)'
          ),
          _react2.default.createElement(
            'option',
            { value: 'letter' },
            'Letter (8.5" x 11")'
          )
        )
      )
    ),
    _react2.default.createElement(
      _DialogActions2.default,
      null,
      _react2.default.createElement(
        _Button2.default,
        { onClick: onClose, color: 'primary' },
        _react2.default.createElement(_reactIntl.FormattedMessage, messages.cancel)
      ),
      _react2.default.createElement(
        _Button2.default,
        { onClick: function onClick() {
            window.print();onClose();
          }, color: 'primary' },
        _react2.default.createElement(_reactIntl.FormattedMessage, messages.print)
      )
    )
  );
};

exports.default = PrintDialog;
//# sourceMappingURL=PrintDialog.js.map