'use strict';

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

var _taggedTemplateLiteral2 = require('babel-runtime/helpers/taggedTemplateLiteral');

var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);

var _templateObject = (0, _taggedTemplateLiteral3.default)(['Invalid child component for Breadcrumbs: ', '.  Only ', '         components may be nested within Breadcrumbs.'], ['Invalid child component for Breadcrumbs: ', '.  Only ', ' \\\n        components may be nested within Breadcrumbs.']);

var _styledComponents = require('styled-components');

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _Breadcrumb = require('./Breadcrumb');

var _Breadcrumb2 = _interopRequireDefault(_Breadcrumb);

var _dedent = require('dedent');

var _dedent2 = _interopRequireDefault(_dedent);

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

var Breadcrumbs = _styledComponents2.default.div.withConfig({
  displayName: 'Breadcrumbs'
})(['& > ', ':not(:last-child)::after{content:\'\0a0 \0a0 \u203A\0a0 \0a0\';}'], _Breadcrumb2.default);

Breadcrumbs.propTypes = {
  children: function children(props) {
    if (!props.children) return;
    var invalidChildren = props.children.filter(function (child) {
      return child.type.displayName !== _Breadcrumb2.default.displayName;
    });
    if (invalidChildren.length > 0) {
      var child = invalidChildren[0];
      var childName = child.type.displayName || child.type.name || child.type;
      return new Error((0, _dedent2.default)(_templateObject, childName, _Breadcrumb2.default.displayName));
    }
  }
};

Breadcrumbs.Breadcrumb = _Breadcrumb2.default;

/** @component */
exports.default = Breadcrumbs;