import PropTypes from "prop-types";
var cardMetaObjectProperties = {
  title: PropTypes.string.isRequired,
  slug: PropTypes.string,
  introText: PropTypes.node,
  additionalText: PropTypes.node,
  shareText: PropTypes.string,
  tags: PropTypes.arrayOf(PropTypes.string),
  selector: PropTypes.node,
  analysis: PropTypes.node,
  metadata: PropTypes.node,
  metadataQA: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
    section: PropTypes.string
  }), PropTypes.shape({
    question: PropTypes.string,
    answer: PropTypes.string
  })])),
  resources: PropTypes.arrayOf(PropTypes.shape({
    heading: PropTypes.string,
    items: PropTypes.arrayOf(PropTypes.shape({
      link: PropTypes.string,
      description: PropTypes.string
    }))
  })),
  authors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.oneOf(["Demo"])])
};
export var optionalCardMetaKeys = {
  selector: true,
  metadataQA: true
};

var getKeyNames = function getKeyNames(obj) {
  var keyNames = {};
  Object.keys(obj).forEach(function (key) {
    keyNames[key] = key;
  });
  return keyNames;
};

export var cardMetaKeys = getKeyNames(cardMetaObjectProperties);
var cardMetaTypes = PropTypes.shape(cardMetaObjectProperties);
export default cardMetaTypes;