'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = require('react');
var React__default = _interopDefault(React);
var __chunk_1 = require('../chunk-f817ce38.js');
var PropTypes = _interopDefault(require('prop-types'));
var index = require('../Chip/index.js');
var __chunk_3 = require('../chunk-6d243953.js');
require('../chunk-2b268ae7.js');
require('../Text/index.js');

var styles = (function (_ref) {
  var palette = _ref.palette;
  return {
    orange: {
      color: palette.orange,
      borderColor: palette.lightOrange
    },
    green: {
      color: palette.green,
      borderColor: palette.lightGreen
    },

    red: {
      color: palette.red,
      borderColor: palette.veryLightRed
    },
    guestToConfirm: {},
    toAnswer: { extend: 'orange' },
    waitingPayment: { extend: 'orange' },
    toConfirm: { extend: 'orange' },
    upcoming: { extend: 'green' },
    expired: { extend: 'red' },
    cancelled: { extend: 'red' },
    missingDetails: { extend: 'orange' }
  };
});

var statusEnum = {
  1: {
    label: 'Guest to confirm',
    styles: 'guestToConfirm'
  },
  2: {
    label: 'to confirm',
    styles: 'toConfirm'
  },
  3: {
    label: 'to answer',
    styles: 'toAnswer'
  },
  4: {
    label: 'waiting payment',
    styles: 'waitingPayment'
  },
  5: {
    label: 'missing details',
    styles: 'missingDetails'
  },
  6: {
    label: 'upcoming',
    styles: 'upcoming'
  },
  7: {
    label: 'expired',
    styles: 'expired'
  },
  8: {
    label: 'cancelled',
    styles: 'cancelled'
  }
};
// eslint-disable-next-line no-unused-vars
var StatusChip = function StatusChip(_ref) {
  var classes = _ref.classes,
      label = _ref.label,
      status = _ref.status,
      className = _ref.className,
      rest = __chunk_3.objectWithoutProperties(_ref, ['classes', 'label', 'status', 'className']);

  var item = statusEnum[status] || statusEnum[1];
  return React__default.createElement(index, __chunk_3._extends({
    label: item.label,
    className: __chunk_1.classNames(classes.root, __chunk_3.defineProperty({}, classes[item.styles], status && item), className && className)
  }, rest));
};

StatusChip.propTypes = {
  classes: PropTypes.object,
  className: PropTypes.string,
  status: PropTypes.oneOf(Object.keys(statusEnum).map(function (el) {
    return parseInt(el);
  })),
  label: PropTypes.string
};

var StatusChip$1 = __chunk_1.withNano(styles)(StatusChip);

module.exports = StatusChip$1;
//# sourceMappingURL=index.js.map
