import React from 'react';
import {Route, Link} from 'react-router-dom';
import {Breadcrumb, BreadcrumbItem} from 'reactstrap';
import routes from '../../routes';
const findRouteName = url => routes[url];
const getPaths = (pathname) => {
const paths = ['/'];
if (pathname === '/') return paths;
pathname.split('/').reduce((prev, curr, index) => {
const currPath = `${prev}/${curr}`;
paths.push(currPath);
return currPath;
});
return paths;
};
const BreadcrumbsItem = ({...rest, match}) => {
const routeName = findRouteName(match.url);
if (routeName) {
return (
match.isExact ?
(
{routeName}
) :
(
{routeName}
)
);
}
return null;
};
const Breadcrumbs = ({...rest, location : {pathname}, match}) => {
const paths = getPaths(pathname);
const items = paths.map((path, i) => );
return (
{items}
);
};
export default props => (
);