|
|
|
@ -9,16 +9,23 @@ const BreadCrumb = ({ breadCrumbs }) => { |
|
|
|
|
{breadCrumbs.map((breadCrumb, index) => ( |
|
|
|
|
<div className="flex flex-row items-center" key={index}> |
|
|
|
|
<span |
|
|
|
|
className={`cursor-pointer text-xs hover:text-blue-900 ${ |
|
|
|
|
breadCrumb.active ? "text-blue-900" : "text-blue-400" |
|
|
|
|
className={`cursor-pointer text-xs hover:text-blue-900 ${ |
|
|
|
|
Number(index) === breadCrumbs.length - 1 |
|
|
|
|
? "text-blue-900" |
|
|
|
|
: "text-blue-400" |
|
|
|
|
}`}
|
|
|
|
|
> |
|
|
|
|
{breadCrumb.name} |
|
|
|
|
{console.log(breadCrumb.active)} |
|
|
|
|
{/* {console.log(breadCrumb.active)} */} |
|
|
|
|
</span> |
|
|
|
|
{Number(index) !== breadCrumbs.length - 1 && ( |
|
|
|
|
<div> |
|
|
|
|
{console.log(breadCrumbs.length - 1)} |
|
|
|
|
{/* {console.log(breadCrumbs)} |
|
|
|
|
{console.log(breadCrumbs[breadCrumbs.length - 1])} |
|
|
|
|
{console.log( |
|
|
|
|
breadCrumb.length ? "text-red-900" : "text-blue-400" |
|
|
|
|
)} */} |
|
|
|
|
|
|
|
|
|
{/* {breadCrumb.active === true ? ( |
|
|
|
|
<img src={grayLeftArrow} className="w-10" /> |
|
|
|
|
) : ( |
|
|
|
@ -43,19 +50,15 @@ BreadCrumb.defaultProps = { |
|
|
|
|
breadCrumbs: [ |
|
|
|
|
{ |
|
|
|
|
name: "صفحه اصلی", |
|
|
|
|
active: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: "آمار و گزارشات", |
|
|
|
|
active: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: "فروش محصولات", |
|
|
|
|
active: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: "سال 1400", |
|
|
|
|
active: true, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|