const flatten = require('lodash.flatten'); const React = require('react'); const ReactIntl = require('react-intl'); const Styled = require('styled-components'); const ReactRouter = require('react-router'); const H1 = require('@ui/components/base-elements').H1; const Li = require('@ui/components/horizontal-list/li'); const PropTypes = require('@root/prop-types'); const Ul = require('@ui/components/horizontal-list/ul'); const fns = require('@ui/shared/functions'); const { default: styled } = Styled; const BreadcrumbA = styled.a` text-decoration: none !important; `; const BreadcrumbSpan = styled.span` color: #646464; `; const { remcalc } = fns; const { FormattedMessage } = ReactIntl; const { Link } = ReactRouter; const Section = ({ children, links = [], name = [] }) => { const navLinks = links.map((link) => (
  • )); const nameLinks = flatten(name.map((part, i) => { if (!part.name) { return null; } const link = ( { ({ href, onClick, }) => {part.name} } ); const slash = ( / ); return (i === 0) ? link : [ slash, link ]; })); return (

    {nameLinks}

    {children}
    ); }; Section.propTypes = { children: React.PropTypes.node, links: React.PropTypes.arrayOf(PropTypes.link), name: React.PropTypes.arrayOf(PropTypes.link) }; module.exports = Section;