You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
822 B
31 lines
822 B
import React,{ Component } from "react";
|
|
import { WordsBtn } from "educoder";
|
|
|
|
class CBreadcrumb extends Component{
|
|
constructor(props){
|
|
super(props);
|
|
|
|
}
|
|
|
|
render(){
|
|
let { items, className, separator }=this.props;
|
|
return(
|
|
<p className={`clearfix mb10 ${className}`}>
|
|
{ items && items.map( (item, index) => {
|
|
if (!item.name) {
|
|
return ''
|
|
}
|
|
if (item.to) {
|
|
return <React.Fragment>
|
|
<WordsBtn style="grey" className="fl hovercolorblue" to={item.to}>{item.name}</WordsBtn>
|
|
<span className="color-grey-9 fl ml3 mr3">{separator || '>'}</span>
|
|
</React.Fragment>
|
|
} else {
|
|
return <span>{item.name}</span>
|
|
}
|
|
})}
|
|
</p>
|
|
)
|
|
}
|
|
}
|
|
export default CBreadcrumb; |