import React from "react";
import Octicon, {Person} from "@primer/octicons-react";
import PropTypes from "prop-types";
export class Navigation extends React.Component {
render() {
const hasNavigation = this.props.navigation && this.props.navigation.length;
if (hasNavigation) {
return (
{this.props.title}
{this.props.afterTitle ? this.props.afterTitle : ''}
{(!hasNavigation && (
{this.props.username}
)) || (
{this.props.navigation.map((nav, index) => {
const navTitle = nav[0];
const navAction = nav[1];
return {navTitle};
})}
)}
);
}
return (
{this.props.title}
);
}
}
Navigation.propTypes = {
title: PropTypes.string.isRequired,
afterTitle: PropTypes.object,
navigation: PropTypes.array,
username: PropTypes.string,
};