import { jsx as _jsx } from "react/jsx-runtime";
import { Icon } from '../icon/Icon.component';
import { STATUS_WARNING, STATUS_CRITICAL, STATUS_HEALTHY, } from '../../components/constants';
import { Loader } from '../loader/Loader.component';
export var Status;
(function (Status) {
    Status["HEALTHY"] = "healthy";
    Status["WARNING"] = "warning";
    Status["CRITICAL"] = "critical";
    Status["UNKNOWN"] = "unknown";
    Status["LOADING"] = "loading";
})(Status || (Status = {}));
export const StatusIcon = ({ status }) => {
    if (status === 'loading') {
        return _jsx(Loader, {});
    }
    const icon = (() => {
        switch (status) {
            case STATUS_HEALTHY:
                return {
                    color: 'statusHealthy',
                    name: 'Check-circle',
                    label: 'Healthy status icon',
                };
            case STATUS_WARNING:
                return {
                    color: 'statusWarning',
                    name: 'Times-circle',
                    label: 'Warning status icon',
                };
            case STATUS_CRITICAL:
                return {
                    color: 'statusCritical',
                    name: 'Times-circle',
                    label: 'Critical status icon',
                };
            default:
                return {
                    color: 'textTertiary',
                    name: 'Info',
                    label: 'Information status icon',
                };
        }
    })();
    return _jsx(Icon, { color: icon.color, name: icon.name, "aria-label": icon.label });
};
