import React from 'react';
import { a as withNano, b as classNames } from '../chunk-566df01b.js';
import PropTypes from 'prop-types';
import Chip from '../Chip/index.js';
import { a as classCallCheck, b as createClass, c as defineProperty, d as inherits, e as objectWithoutProperties, f as possibleConstructorReturn, g as slicedToArray, h as _typeof, i as _extends } from '../chunk-aad905a2.js';
import '../chunk-aeb80e51.js';
import '../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 = objectWithoutProperties(_ref, ['classes', 'label', 'status', 'className']);

  var item = statusEnum[status] || statusEnum[1];
  return React.createElement(Chip, _extends({
    label: item.label,
    className: classNames(classes.root, 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 = withNano(styles)(StatusChip);

export default StatusChip$1;
//# sourceMappingURL=index.js.map
