<commit_before>/**
 * ActiveDashboard.jsx
 * Created by <NAME> 3/10/20
 */

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

import ActiveDashboardOverviewContainer from 'containers/dashboard/ActiveDashboardOverviewContainer';
import ActiveDashboardImpactsContainer from 'containers/dashboard/ActiveDashboardImpactsContainer';
import SignificanceGraphContainer from 'containers/dashboard/graph/SignificanceGraphContainer';
import ActiveDashboardTableContainer from 'containers/dashboard/table/ActiveDashboardTableContainer';
import ErrorLevelTab from './ErrorLevelTab';

const propTypes = {
    submissionID: PropTypes.string,
    numResults: PropTypes.number,
    backToList: PropTypes.func
};

const errorLevels = ['error', 'warning'];
const ActiveDashboard = (props) => {
    const [errorLevel, setErrorLevel] = useState('warning');
    return (
        <div className="dashboard-page-active">
            <div className="dashboard-tabs dashboard-tabs_active">
                <div className="dashboard-tabs__content">
                    {errorLevels.map((level) => (
                        <ErrorLevelTab
                            errorLevel={level}
                            setErrorLevel={setErrorLevel}
                            active={errorLevel === level} />
                    ))}
                </div>
            </div>
            <div className="dashboard-page__content">
                {props.numResults > 1 ?
                    <button
                        onClick={props.backToList}
                        className="back-button">
                        <div className="button-wrapper">
                            <div className="button-icon">
                                <FontAwesomeIcon icon="angle-left" />
                            </div>
                            <div className="button-content">
                                Dashboard Submission Selection
                            </div><commit_msg>add unique key to the tabs<commit_after>/**
 * ActiveDashboard.jsx
 * Created by <NAME> 3/10/20
 */

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

import ActiveDashboardOverviewContainer from 'containers/dashboard/ActiveDashboardOverviewContainer';
import ActiveDashboardImpactsContainer from 'containers/dashboard/ActiveDashboardImpactsContainer';
import SignificanceGraphContainer from 'containers/dashboard/graph/SignificanceGraphContainer';
import ActiveDashboardTableContainer from 'containers/dashboard/table/ActiveDashboardTableContainer';
import ErrorLevelTab from './ErrorLevelTab';

const propTypes = {
    submissionID: PropTypes.string,
    numResults: PropTypes.number,
    backToList: PropTypes.func
};

const errorLevels = ['error', 'warning'];
const ActiveDashboard = (props) => {
    const [errorLevel, setErrorLevel] = useState('warning');
    return (
        <div className="dashboard-page-active">
            <div className="dashboard-tabs dashboard-tabs_active">
                <div className="dashboard-tabs__content">
                    {errorLevels.map((level) => (
                        <ErrorLevelTab
                            key={level}
                            errorLevel={level}
                            setErrorLevel={setErrorLevel}
                            active={errorLevel === level} />
                    ))}
                </div>
            </div>
            <div className="dashboard-page__content">
                {props.numResults > 1 ?
                    <button
                        onClick={props.backToList}
                        className="back-button">
                        <div className="button-wrapper">
                            <div className="button-icon">
                                <FontAwesomeIcon icon="angle-left" />
                            </div>
                            <div className="button-content">
                                Dashboard Submission Selection
                            </div>
{'fraction_non_alphanumeric': 0.09703828557669154, 'fraction_numerical': 0.002889477486154587, 'mean_word_length': 1.9150877192982456, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 39, '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': '3010452', 'n_tokens_mistral': 985, 'n_tokens_neox': 983, 'n_words': 193}