<commit_before>import debug from "debug";
import React, { Component } from "react";
import Session from "../session";

const log = debug("schedule:components:next-up");

export class NextUp extends Component {
    render() {
        const { getState } = this.props;
        const { days, time: { today, now } } = getState();

        let currentDay = Object.keys(days).filter(d => today <= new Date(d)).shift();
        let tracks = Object.keys(days[currentDay].tracks).map(name => ({ name, sessions: days[currentDay].tracks[name] }));

        let nextSessions = tracks.map(t => {
            return {
                ...t,
                sessions: [t.sessions.filter(s => now <= s.start).shift()]
            };
        }).
        sort((a, b) => {
            return Number(a.sessions[0].start) - Number(b.sessions[0].start);
        });

        return (
            <div className="next-up">
                {
                    nextSessions.map(t => {
                        return (
                            <div className="next-up__session">
                                <h2>Track: {t.name}</h2>
                                <Session session={t.next} />
                            </div>
                        );
                    })
                }
            </div>
        );
    }
}

export default NextUp;<commit_msg>Fix use track component in next-up view<commit_after>import debug from "debug";
import React, { Component } from "react";
import Track from "../track";

const log = debug("schedule:components:next-up");

export class NextUp extends Component {
    render() {
        const { getState } = this.props;
        const { days, time: { today, now } } = getState();

        let currentDay = Object.keys(days).filter(d => today <= new Date(d)).shift();
        let tracks = Object.keys(days[currentDay].tracks).map(name => ({ name, sessions: days[currentDay].tracks[name] }));

        let nextSessions = tracks.map(t => {
            return {
                ...t,
                sessions: [t.sessions.filter(s => now <= s.start).shift()]
            };
        }).
        sort((a, b) => {
            return Number(a.sessions[0].start) - Number(b.sessions[0].start);
        });

        return (
            <div className="next-up">
                {
                    nextSessions.map(t => {
                        return (
                            <div key={t.name} className="next-up__session">
                                <Track { ...t } />
                            </div>
                        );
                    })
                }
            </div>
        );
    }
}

export default NextUp;
{'fraction_non_alphanumeric': 0.14505247376311844, 'fraction_numerical': 0.0022488755622188904, 'mean_word_length': 1.357773851590106, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, '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': '7231068', 'n_tokens_mistral': 725, 'n_tokens_neox': 700, 'n_words': 150}