<commit_before>import * as React from 'react';

import { NotificationType } from 'argo-ui';
import { ARGO_FAILED_COLOR, ARGO_RUNNING_COLOR, ARGO_SUCCESS_COLOR, ErrorNotification } from '../../shared/components';
import * as appModels from '../../shared/models';
import { services } from '../../shared/services';

export async function deleteApplication(appName: string, force: boolean, success: () => void) {
    const confirmed = await this.appContext.apis.popup.confirm('Delete application', `Are you sure you want to delete the application "${appName}"?`);
    if (confirmed) {
        try {
            await services.applications.delete(appName, force);
            success();
        } catch (e) {
            this.appContext.apis.notifications.show({
                content: <ErrorNotification title='Unable to delete application' e={e}/>,
                type: NotificationType.Error,
            });
        }
    }
};

export const ComparisonStatusIcon = ({status}: { status: appModels.ComparisonStatus }) => {
    let className = '';
    let color = '';

    switch (status) {
        case appModels.ComparisonStatuses.Synced:
            className = 'fa fa-check-circle';
            color = ARGO_SUCCESS_COLOR;
            break;
        case appModels.ComparisonStatuses.OutOfSync:
            className = 'fa fa-times';
            color = ARGO_FAILED_COLOR;
            break;
        case appModels.ComparisonStatuses.Error:
            className = 'fa fa-exclamation-circle';
            color = ARGO_FAILED_COLOR;
            break;
        case appModels.ComparisonStatuses.Unknown:
            className = 'fa fa-circle-o-notch status-icon--running status-icon--spin';
            color = ARGO_RUNNING_COLOR;
            break;
    }
    return <i title={status} className={className} style={{ color }} />;
};

export const HealthStatusIcon = ({state}: { state: appModels.HealthStatus }) => {
    let color = '';
<commit_msg>Rm unnecessary semicolon, thanks linter<commit_after>import * as React from 'react';

import { NotificationType } from 'argo-ui';
import { ARGO_FAILED_COLOR, ARGO_RUNNING_COLOR, ARGO_SUCCESS_COLOR, ErrorNotification } from '../../shared/components';
import * as appModels from '../../shared/models';
import { services } from '../../shared/services';

export async function deleteApplication(appName: string, force: boolean, success: () => void) {
    const confirmed = await this.appContext.apis.popup.confirm('Delete application', `Are you sure you want to delete the application "${appName}"?`);
    if (confirmed) {
        try {
            await services.applications.delete(appName, force);
            success();
        } catch (e) {
            this.appContext.apis.notifications.show({
                content: <ErrorNotification title='Unable to delete application' e={e}/>,
                type: NotificationType.Error,
            });
        }
    }
}

export const ComparisonStatusIcon = ({status}: { status: appModels.ComparisonStatus }) => {
    let className = '';
    let color = '';

    switch (status) {
        case appModels.ComparisonStatuses.Synced:
            className = 'fa fa-check-circle';
            color = ARGO_SUCCESS_COLOR;
            break;
        case appModels.ComparisonStatuses.OutOfSync:
            className = 'fa fa-times';
            color = ARGO_FAILED_COLOR;
            break;
        case appModels.ComparisonStatuses.Error:
            className = 'fa fa-exclamation-circle';
            color = ARGO_FAILED_COLOR;
            break;
        case appModels.ComparisonStatuses.Unknown:
            className = 'fa fa-circle-o-notch status-icon--running status-icon--spin';
            color = ARGO_RUNNING_COLOR;
            break;
    }
    return <i title={status} className={className} style={{ color }} />;
};

export const HealthStatusIcon = ({state}: { state: appModels.HealthStatus }) => {
    let color = '';

{'fraction_non_alphanumeric': 0.12196989027813218, 'fraction_numerical': 0.0, 'mean_word_length': 2.5031277926720286, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '357088', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1039, 'n_words': 260}