import React from 'react';
import { Link } from "react-router-dom";
import { Col, Row } from "reactstrap";
import { useMainLayoutStyle } from './MainLayout';
export default function Breadcrumb({ data, title, children }) {
const _data = (data || []).filter(a => !!a);
const _title = title || (_data.length === 1 ? _data[0].name : _data.length > 1 ? <>{_data[_data.length - 1].name} ({_data[0].name})> : null);
const mainLayoutParams = useMainLayoutStyle();
if (!mainLayoutParams.bg) {
return <>
{_title &&
{_title}
}
{ children }
>;
}
return <>
{_title &&
{_title}
}
-
{_data.map((a, i) => -
{a.name}
)}
{ children }
>;
}