<commit_before>import { h, Component }					from 'preact/preact';

import ContentPost						from 'com/content-post/post';

import ContentUsers						from 'com/content-users/users';
import ContentUser						from 'com/content-user/user';
import ContentUserFollowing             from 'com/content-user/user-following';
import ContentUserGames                 from 'com/content-user/user-games';

import ContentTimeline					from 'com/content-timeline/timeline';
import ContentGames						from 'com/content-games/games';
import ContentEvent						from 'com/content-event/event';
//import ContentEvents					from 'com/content-events/events';
import ContentGroup						from 'com/content-group/group';
import Content404						from 'com/content-404/404';
import ContentItem						from 'com/content-item/item';

import ContentComments					from 'com/content-comments/comments';

import ContentNavRoot					from 'com/content-nav/nav-root';
import ContentNavUser					from 'com/content-nav/nav-user';
import ContentNavEvent					from 'com/content-nav/nav-event';
import ContentNavTheme					from 'com/content-nav/nav-theme';

import ContentEventTheme				from 'com/content-event/event-theme';

import ContentPalette					from 'com/content-palette/palette';

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

	getContent( {node, user, path, extra} ) {
		if ( node.name ) {
			document.title = titleParser.parse(node.name, true);
			if ( document.title === "" )
				document.title = window.location.host;
			else
				document.title += " | " + window.location.host;
		}
		else {
			document.title = window.location.host;
		}

		var EditMode = extra && extra.length && extra[extra.length-1] == 'edit';

		if ( node.type === 'post' ) {
			var Content = [];
			Content.push(<ContentPost node={node} user={user} path={path} extra={extra} authored by love />);

			if ( !EditMode ) {
				Content.push(<ContentComments node={node} user={user} path={path} extra={extra} />);
			}

			return (
				<div id="content">
					{Content}
				</div>
			);
		}
		else if ( node.type === 'page' ) {
			return (
				<div id="content">
					<ContentPost node={node} user={user} path={path} extra={extra} updated />
				</div>
			);
		}
		else if ( node.type === 'item' ) {
			return (
				<div id="content">
					<ContentItem node={node} user={user} path={path} extra={extra} />
					<ContentComments node={node} user={user} path={path} extra={extra} />
				</div>
			);
		}
		else if ( node.type === 'user' ) {
			let View = [];
			let ViewType = null;

			if ( extra.length ) {
				ViewType = extra[0];
			}
			else {
				// Default View (i.e. URL is `/`)
				/*if ( node['games'] > 0 ) //Disabled games as default as api needs work
					ViewType = 'games';
				else*/ if ( node['articles'] > 0 )
					ViewType = 'articles';
				else
					ViewType = 'feed';
			}

			// When root edit mode is detected
			if ( extra.length && extra[0] == 'edit' ) {
				// Do nothing
			}
			else {
				if ( ViewType ) {
					if ( ViewType == 'articles' ) {
						View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentTimeline types={['page']} methods={['author']} node={node} user={user} path={path} extra={extra} />);
					}
					else if ( ViewType == 'feed' ) {
                        View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentTimeline types={['post']} methods={['author']} node={node} user={user} path={path} extra={extra} />);
					}
					else if ( ViewType == 'post' ) {
//						View.push(<ContentPost node={node} user={user} path={path} extra={extra.splice(1)} by love edit />);
					}
					else if ( ViewType == 'games' ) {
						View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentGames node={node} user={user} path={path} extra={extra} />);
					}
					else if ( ViewType == 'article' ) {

					}
                    else if ( ViewType == 'following'){<commit_msg>Fixed /users/games<commit_after>import { h, Component }					from 'preact/preact';

import ContentPost						from 'com/content-post/post';

import ContentUsers						from 'com/content-users/users';
import ContentUser						from 'com/content-user/user';
import ContentUserFollowing             from 'com/content-user/user-following';
import ContentUserGames                 from 'com/content-user/user-games';

import ContentTimeline					from 'com/content-timeline/timeline';
import ContentGames						from 'com/content-games/games';
import ContentEvent						from 'com/content-event/event';
//import ContentEvents					from 'com/content-events/events';
import ContentGroup						from 'com/content-group/group';
import Content404						from 'com/content-404/404';
import ContentItem						from 'com/content-item/item';

import ContentComments					from 'com/content-comments/comments';

import ContentNavRoot					from 'com/content-nav/nav-root';
import ContentNavUser					from 'com/content-nav/nav-user';
import ContentNavEvent					from 'com/content-nav/nav-event';
import ContentNavTheme					from 'com/content-nav/nav-theme';

import ContentEventTheme				from 'com/content-event/event-theme';

import ContentPalette					from 'com/content-palette/palette';

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

	getContent( {node, user, path, extra} ) {
		if ( node.name ) {
			document.title = titleParser.parse(node.name, true);
			if ( document.title === "" )
				document.title = window.location.host;
			else
				document.title += " | " + window.location.host;
		}
		else {
			document.title = window.location.host;
		}

		var EditMode = extra && extra.length && extra[extra.length-1] == 'edit';

		if ( node.type === 'post' ) {
			var Content = [];
			Content.push(<ContentPost node={node} user={user} path={path} extra={extra} authored by love />);

			if ( !EditMode ) {
				Content.push(<ContentComments node={node} user={user} path={path} extra={extra} />);
			}

			return (
				<div id="content">
					{Content}
				</div>
			);
		}
		else if ( node.type === 'page' ) {
			return (
				<div id="content">
					<ContentPost node={node} user={user} path={path} extra={extra} updated />
				</div>
			);
		}
		else if ( node.type === 'item' ) {
			return (
				<div id="content">
					<ContentItem node={node} user={user} path={path} extra={extra} />
					<ContentComments node={node} user={user} path={path} extra={extra} />
				</div>
			);
		}
		else if ( node.type === 'user' ) {
			let View = [];
			let ViewType = null;

			if ( extra.length ) {
				ViewType = extra[0];
			}
			else {
				// Default View (i.e. URL is `/`)
				/*if ( node['games'] > 0 ) //Disabled games as default as api needs work
					ViewType = 'games';
				else*/ if ( node['articles'] > 0 )
					ViewType = 'articles';
				else
					ViewType = 'feed';
			}

			// When root edit mode is detected
			if ( extra.length && extra[0] == 'edit' ) {
				// Do nothing
			}
			else {
				if ( ViewType ) {
					if ( ViewType == 'articles' ) {
						View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentTimeline types={['page']} methods={['author']} node={node} user={user} path={path} extra={extra} />);
					}
					else if ( ViewType == 'feed' ) {
                        View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentTimeline types={['post']} methods={['author']} node={node} user={user} path={path} extra={extra} />);
					}
					else if ( ViewType == 'post' ) {
//						View.push(<ContentPost node={node} user={user} path={path} extra={extra.splice(1)} by love edit />);
					}
					else if ( ViewType == 'games' ) {
						View.push(<ContentNavUser node={node} user={user} path={path} extra={extra} />);
						View.push(<ContentGames node={node} user={user} path={path} extra={extra} methods={['author']}/>);
					}
					else if ( ViewType == 'article' ) {

					}
                    else if ( ViewType == 'following'){
{'fraction_non_alphanumeric': 0.16590261429810432, 'fraction_numerical': 0.0037170115227357207, 'mean_word_length': 2.9920870425321464, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '3605448', 'n_tokens_mistral': 3162, 'n_tokens_neox': 2540, 'n_words': 589}