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

import ContentEventHome					from 'com/content-event/event-home';
import ContentEventIdea					from 'com/content-event/event-idea';
import ContentEventSlaughter			from 'com/content-event/event-slaughter';
import ContentEventFusion				from 'com/content-event/event-fusion';
import ContentEventList					from 'com/content-event/event-list';
//import ContentEventFinal				from 'com/content-event/event-final';
//import ContentEventJudging				from 'com/content-event/event-judging';
//import ContentEventResults				from 'com/content-event/event-results';

import ContentCommon					from 'com/content-common/common';
import ContentCommonBody				from 'com/content-common/common-body';
import ContentCommonNav					from 'com/content-common/common-nav';
import ContentCommonNavButton			from 'com/content-common/common-nav-button';
import ContentCommonBodyTitle			from 'com/content-common/common-body-title';
import ContentCommonBodyMarkup			from 'com/content-common/common-body-markup';


import ContentSimple					from 'com/content-simple/simple';


export default class ContentEvent extends Component {
	constructor( props ) {
		super(props);
//
//		this.state = {
//			'editing': this.isEditMode(),
//			'modified': false,
//
//			'body': props.node.body,
//		};
		this.onJoin = this.onJoin.bind(this);
	}

//	componentDidMount() {
//	}
//	componentWillUnmount() {
//	}

//	isEditMode() {
//		var extra = this.props.extra;
//		return extra && extra.length && extra[extra.length-1] == 'edit';
//	}

	onJoin( e ) {
		console.log('join');
	}
	
	render( props, state ) {
		props = Object.assign({}, props);
		
		var node = props.node;
		var user = props.user;
		var path = props.path;
		var extra = props.extra;
		
		if ( node ) {
			props.header = "EVENT";
			props.headerClass = "-col-ab";
			props.titleIcon = "trophy";
		}

		var ShowHome = null;
		var IsHome = false;
		if ( true ) {
			let Class = null;
			if ( extra && extra.length == 0 ) {
				Class = "-selected";
				IsHome = true;
			}

			ShowHome = <ContentCommonNavButton href={path} class={Class}><SVGIcon>home</SVGIcon>Home</ContentCommonNavButton>;
		}
		
		var ShowGame = null;
		if ( true ) {
			let Class = null;
//			if ( extra && extra.length ) {
				Class = "-disabled";
//			}

			ShowGame = <ContentCommonNavButton onclick={this.onJoin} class={Class}><SVGIcon>gamepad</SVGIcon>Join Event</ContentCommonNavButton>;
		}
		
		var ShowFeed = null;
//		if ( true ) {
//			let Class = null;
//			if ( extra && extra.length ) {
//				if ( extra[0] === 'feed' || extra[0] === 'hot' || extra[0] === 'news' || extra[0] === 'games' ) {
//					Class = "-selected";
//				}
//			}
//			// Root node, context sensitive
//			else {
//				// If not logged in
//				if ( user && user.id === 0 ) {
//					Class = "-selected";
//				}
//			}
//			
//			ShowFeed = <ContentCommonNavButton href={path} class={Class}><SVGIcon>feed</SVGIcon>Feed</ContentCommonNavButton>;	
//		}

		var ShowTheme = null;
		if ( true ) {
			let Class = null;
			if ( extra && extra.length ) {
				if ( extra[0] === 'theme' ) {
					Class = "-selected";
				}
			}

			ShowTheme = <ContentCommonNavButton href={path+'/theme'} class={Class}><SVGIcon>ticket</SVGIcon>Theme Selection</ContentCommonNavButton>;
		}
		
		if ( !IsHome )
			props.nomarkup = true;
		
		props.class = 'content-event';
		props.above = [];
		
		if ( node.meta['event-start'] && node.meta['event-end'] ) {
			let Start = new Date(node.meta['event-start']);
			let End = new Date(node.meta['event-end']);
			
			props.above.push(
				<ContentCommonBody>
					<div><SVGIcon small baseline gap>calendar</SVGIcon> {getLocaleDay(Start)} {getLocaleMonthDay(Start)} to <span class="if-sidebar-inline">{getLocaleDay(End)}</span> {getLocaleDate(End)}</div>
					<div><SVGIcon small baseline gap>clock</SVGIcon><strong> {getLocaleTime(Start)}</strong> {getLocaleTimeZone(Start)}</div>
				</ContentCommonBody>
			);
		}
		
		return (
			<ContentSimple {...props}>
				<ContentCommonNav>
					{ShowHome}
					{ShowGame}
					{ShowFeed}
					{ShowTheme}
				</ContentCommonNav>
			</ContentSimple>
		);
			
//		props = Object.assign({}, props);	// Shallow copy we can change props
//
//		var node = props.node;
//		var user = props.user;
//		var path = props.path;
//		var extra = props.extra;
//		var error = state.error;
//
//		if ( node.slug ) {
//			return (
//				<ContentCommon {...props}>
//					<ContentCommonBodyTitle href={path} title={node.name} />
//					<ContentCommonBodyMarkup 
//						node={node} 
//						editing={state.editing}
//						placeholder="Say something"<commit_msg>added more words<commit_after>import { h, Component } 				from 'preact/preact';
import NavSpinner						from 'com/nav-spinner/spinner';
import NavLink 							from 'com/nav-link/link';
import SVGIcon 							from 'com/svg-icon/icon';

import ContentEventHome					from 'com/content-event/event-home';
import ContentEventIdea					from 'com/content-event/event-idea';
import ContentEventSlaughter			from 'com/content-event/event-slaughter';
import ContentEventFusion				from 'com/content-event/event-fusion';
import ContentEventList					from 'com/content-event/event-list';
//import ContentEventFinal				from 'com/content-event/event-final';
//import ContentEventJudging				from 'com/content-event/event-judging';
//import ContentEventResults				from 'com/content-event/event-results';

import ContentCommon					from 'com/content-common/common';
import ContentCommonBody				from 'com/content-common/common-body';
import ContentCommonNav					from 'com/content-common/common-nav';
import ContentCommonNavButton			from 'com/content-common/common-nav-button';
import ContentCommonBodyTitle			from 'com/content-common/common-body-title';
import ContentCommonBodyMarkup			from 'com/content-common/common-body-markup';


import ContentSimple					from 'com/content-simple/simple';


export default class ContentEvent extends Component {
	constructor( props ) {
		super(props);
//
//		this.state = {
//			'editing': this.isEditMode(),
//			'modified': false,
//
//			'body': props.node.body,
//		};
		this.onJoin = this.onJoin.bind(this);
	}

//	componentDidMount() {
//	}
//	componentWillUnmount() {
//	}

//	isEditMode() {
//		var extra = this.props.extra;
//		return extra && extra.length && extra[extra.length-1] == 'edit';
//	}

	onJoin( e ) {
		console.log('join');
	}
	
	render( props, state ) {
		props = Object.assign({}, props);
		
		var node = props.node;
		var user = props.user;
		var path = props.path;
		var extra = props.extra;
		
		if ( node ) {
			props.header = "EVENT";
			props.headerClass = "-col-ab";
			props.titleIcon = "trophy";
		}

		var ShowHome = null;
		var IsHome = false;
		if ( true ) {
			let Class = null;
			if ( extra && extra.length == 0 ) {
				Class = "-selected";
				IsHome = true;
			}

			ShowHome = <ContentCommonNavButton href={path} class={Class}><SVGIcon>home</SVGIcon>Home</ContentCommonNavButton>;
		}
		
		var ShowGame = null;
		if ( true ) {
			let Class = null;
//			if ( extra && extra.length ) {
				Class = "-disabled";
//			}

			ShowGame = <ContentCommonNavButton onclick={this.onJoin} class={Class}><SVGIcon>gamepad</SVGIcon>Join Event</ContentCommonNavButton>;
		}
		
		var ShowFeed = null;
//		if ( true ) {
//			let Class = null;
//			if ( extra && extra.length ) {
//				if ( extra[0] === 'feed' || extra[0] === 'hot' || extra[0] === 'news' || extra[0] === 'games' ) {
//					Class = "-selected";
//				}
//			}
//			// Root node, context sensitive
//			else {
//				// If not logged in
//				if ( user && user.id === 0 ) {
//					Class = "-selected";
//				}
//			}
//			
//			ShowFeed = <ContentCommonNavButton href={path} class={Class}><SVGIcon>feed</SVGIcon>Feed</ContentCommonNavButton>;	
//		}

		var ShowTheme = null;
		if ( true ) {
			let Class = null;
			if ( extra && extra.length ) {
				if ( extra[0] === 'theme' ) {
					Class = "-selected";
				}
			}

			ShowTheme = <ContentCommonNavButton href={path+'/theme'} class={Class}><SVGIcon>ticket</SVGIcon>Theme Selection</ContentCommonNavButton>;
		}
		
		if ( !IsHome )
			props.nomarkup = true;
		
		props.class = 'content-event';
		props.above = [];
		
		if ( node.meta['event-start'] && node.meta['event-end'] ) {
			let Start = new Date(node.meta['event-start']);
			let End = new Date(node.meta['event-end']);
			
			props.above.push(
				<ContentCommonBody>
					<div><SVGIcon small baseline gap>calendar</SVGIcon> {getLocaleDay(Start)} {getLocaleMonthDay(Start)} to <span class="if-sidebar-inline">{getLocaleDay(End)}</span> {getLocaleDate(End)}</div>
					<div><SVGIcon small baseline gap>clock</SVGIcon><strong> Starts at {getLocaleTime(Start)}</strong> {getLocaleTimeZone(Start)}</div>
				</ContentCommonBody>
			);
		}
		
		return (
			<ContentSimple {...props}>
				<ContentCommonNav>
					{ShowHome}
					{ShowGame}
					{ShowFeed}
					{ShowTheme}
				</ContentCommonNav>
			</ContentSimple>
		);
			
//		props = Object.assign({}, props);	// Shallow copy we can change props
//
//		var node = props.node;
//		var user = props.user;
//		var path = props.path;
//		var extra = props.extra;
//		var error = state.error;
//
//		if ( node.slug ) {
//			return (
//				<ContentCommon {...props}>
//					<ContentCommonBodyTitle href={path} title={node.name} />
//					<ContentCommonBodyMarkup 
//						node={node} 
//						editing={state.editing}
//						placeholder="Say something"
{'fraction_non_alphanumeric': 0.16765717860494214, 'fraction_numerical': 0.0016682306328849963, 'mean_word_length': 3.0251783466219053, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 75, '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': '5875861', 'n_tokens_mistral': 3802, 'n_tokens_neox': 3259, 'n_words': 647}