<commit_before>import * as ui from "../ui";
import * as React from "react";
import {csx, Tabs} from "../ui";
import * as tab from "./tab";
import {DashboardTab} from "./dashboardTab";
import * as commands from "../commands/commands";

export interface Props {

}

export interface State {
    selected?: string;
    tabs?: tab.TabInstance[];
}

@ui.Radium
export class TabsContainer extends ui.BaseComponent<Props, State>{

    constructor(props: Props) {
        super(props);

        let dashboard1: tab.TabInstance = new DashboardTab('foo');
        let dashboard2: tab.TabInstance = new DashboardTab('bar');;

        this.state = {
            selected: dashboard2.url,
            tabs: [dashboard1, dashboard2]
        };
    }

    refs: { [string: string]: any; }

    componentDidMount() {
        commands.nextTab.on(() => {
            console.log('next tab');
        });
        commands.prevTab.on(() => {
            console.log('previous tab');
        });
    }

    render() {
        let tabs = this.state.tabs.map((T, index) => <ui.Tab key={index} label={T.getTitle()} value={T.url}>
            <T.Component/>
        </ui.Tab>);

        return <Tabs valueLink={{value:this.state.selected}}>
                {tabs}
            </Tabs>;
    }<commit_msg>chore(tabs) don't add stuff that dont work<commit_after>import * as ui from "../ui";
import * as React from "react";
import {csx, Tabs} from "../ui";
import * as tab from "./tab";
import {DashboardTab} from "./dashboardTab";
import * as commands from "../commands/commands";

export interface Props {

}

export interface State {
    selected?: string;
    tabs?: tab.TabInstance[];
}

@ui.Radium
export class TabsContainer extends ui.BaseComponent<Props, State>{

    constructor(props: Props) {
        super(props);

        let dashboard1: tab.TabInstance = new DashboardTab('foo');
        let dashboard2: tab.TabInstance = new DashboardTab('bar');;

        this.state = {
            selected: dashboard2.url,
            tabs: [dashboard1, dashboard2]
        };
    }

    refs: { [string: string]: any; }

    componentDidMount() {
        commands.nextTab.on(() => {
            console.log('next tab');
        });
        commands.prevTab.on(() => {
            console.log('previous tab');
        });
    }

    render() {
        let tabs = this.state.tabs.map((T, index) => <ui.Tab key={index} label={T.getTitle()}>
            <T.Component/>
        </ui.Tab>);

        return <Tabs>
                {tabs}
            </Tabs>;
    }
{'fraction_non_alphanumeric': 0.15697904310003954, 'fraction_numerical': 0.0039541320680110716, 'mean_word_length': 2.2270408163265305, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '496523', 'n_tokens_mistral': 773, 'n_tokens_neox': 748, 'n_words': 188}