<commit_before>import { h, Component } 				from 'preact/preact';
import SVGIcon 							from 'com/svg-icon/icon';
import NavLink 							from 'com/nav-link/link';

import ContentNavButton					from 'com/content-nav/nav-button';


export default class ContentNavUser extends Component {
	constructor( props ) {
		super(props);
	}

	componentDidMount() {
	}


	render( {node, user, path, extra}, {} ) {

        var NewPath = '/'+ (extra ? extra.join('/') : '');
		var PartPath = '/'+ (extra && extra.length ? extra[0] : '');

		var ShowMyFeed = null;
		if ( NewPath === '/' ) {
			// Default to games, articles, or feed if no games/articles are available
            // Disabled games as default because its doesn't work great.
			/*if ( node['games'] > 0 )
				NewPath = '/games';
			else*/ if ( node['articles'] > 0 )
				NewPath = '/articles';
			else
				NewPath = '/feed';
		}
		// Prefix with path
		NewPath = path + NewPath;
		PartPath = path + PartPath;

		var HasFeed = <ContentNavButton path={NewPath} icon='feed' href={path+'/feed'}>Feed</ContentNavButton>;

		var HasFollowing = null;
		if ( user.id == node.id && user && user.private /*&& user.private["link"] && user.private.link["star"]*/ ) {
			HasFollowing = <ContentNavButton path={NewPath} icon='user-check' href={path+'/following'}>Following</ContentNavButton>;
		}

		var HasFollowers = null;
//		if ( user.id == node.id && user["private"] && user.private["refs"] && user.private.refs["star"]  ) {
//			HasFollowers = <ContentNavButton path={NewPath} icon='users' href={path+'/followers'}>Followers</ContentNavButton>;
//		}

        var HasGames = null;
		//if ( node['games'] > 0 ) {
			HasGames = <ContentNavButton path={PartPath} icon='gamepad' href={path+'/games'}>Games</ContentNavButton>;
		//}

		var HasArticles = null;
		if ( node['articles'] > 0 ) {
			HasArticles = <ContentNavButton path={NewPath} icon='article' href={path+'/articles'}>Articles</ContentNavButton>;
		}

		return (
			<div class="-body">
				<div class="content-base content-nav content-nav-root">
					{HasArticles}
					{HasFeed}<commit_msg>always show games tab<commit_after>import { h, Component } 				from 'preact/preact';
import SVGIcon 							from 'com/svg-icon/icon';
import NavLink 							from 'com/nav-link/link';

import ContentNavButton					from 'com/content-nav/nav-button';


export default class ContentNavUser extends Component {
	constructor( props ) {
		super(props);
	}

	componentDidMount() {
	}


	render( {node, user, path, extra}, {} ) {

        var NewPath = '/'+ (extra ? extra.join('/') : '');
		var PartPath = '/'+ (extra && extra.length ? extra[0] : '');

		var ShowMyFeed = null;
		if ( NewPath === '/' ) {
			// Default to games, articles, or feed if no games/articles are available
            // Disabled games as default because its doesn't work great.
			/*if ( node['games'] > 0 )
				NewPath = '/games';
			else*/ if ( node['articles'] > 0 )
				NewPath = '/articles';
			else
				NewPath = '/feed';
		}
		// Prefix with path
		NewPath = path + NewPath;
		PartPath = path + PartPath;

		var HasFeed = <ContentNavButton path={NewPath} icon='feed' href={path+'/feed'}>Feed</ContentNavButton>;

		var HasFollowing = null;
		if ( user.id == node.id && user && user.private /*&& user.private["link"] && user.private.link["star"]*/ ) {
			HasFollowing = <ContentNavButton path={NewPath} icon='user-check' href={path+'/following'}>Following</ContentNavButton>;
		}

		var HasFollowers = null;
//		if ( user.id == node.id && user["private"] && user.private["refs"] && user.private.refs["star"]  ) {
//			HasFollowers = <ContentNavButton path={NewPath} icon='users' href={path+'/followers'}>Followers</ContentNavButton>;
//		}

        var HasGames = null;
		HasGames = <ContentNavButton path={PartPath} icon='gamepad' href={path+'/games'}>Games</ContentNavButton>;

		var HasArticles = null;
		if ( node['articles'] > 0 ) {
			HasArticles = <ContentNavButton path={NewPath} icon='article' href={path+'/articles'}>Articles</ContentNavButton>;
		}

		return (
			<div class="-body">
				<div class="content-base content-nav content-nav-root">
					{HasArticles}
					{HasFeed}
{'fraction_non_alphanumeric': 0.17373493975903614, 'fraction_numerical': 0.002168674698795181, 'mean_word_length': 3.477885652642934, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4099661', 'n_tokens_mistral': 1536, 'n_tokens_neox': 1333, 'n_words': 309}