<?php 

class icon
{
    private  static function types(string $_type){
        switch ($_type) {
            // Alertes
            case 'info':
                return "bi bi-info-circle";
                break;
            case 'warning':
                return "bi bi-exclamation-diamond";
                break;
            case 'alert':
                return "bi bi-exclamation-triangle";
                break;
            // Menu Salariés
            case 'rh-liste-salaries':
                return "bi bi-people-fill";
                break;
            case 'rh-historique-excel':
                return "bi bi-list-check";
                break;
            case 'rh-historique-excel':
                return "bi bi-clock-history";
                break;
            case 'stats':
                return "bi bi-graph-up";
                break;
            // Menu Proweb
            case 'proweb-salaries':
                return "bi bi-people";
                break;
            case 'proweb-historique-excel':
                return "bi bi-list-check";
                break;
            case 'proweb-export-csv':
                    return "bi bi-upload";
                    break;
            // Menu Comptes bancaires
            case 'compte-1':
                    return "bi bi-safe2";
                    break;
            case 'compte-2':
                return "bi bi-safe2";
                break;
            case 'compte-3':
                return "bi bi-piggy-bank";
                break;
            case 'compte-4':
                return "bi bi-piggy-bank";
                break;
            case 'compte-historique-csv':
                return "bi bi-list-check";
                break;
            // Menu Documents
            case 'documents':
                return "bi bi-journal-check";
                break;
            // Menu Services sociaux
            case 'sociale-check-salarie':
                return "bi bi-person-check-fill";
                break;
            // Menu Evènements
            case 'evenements':
                return "bi bi-calendar2-check";
                break;
            case 'lotterys':
                return "bi bi-dice-6";
                break;
            // Menu Pratique    
            case 'pratique':
                return "bi bi-link-45deg";
                break;
            // Menu Parametres
            case 'parametre-users':
                return "bi bi-person-lines-fill";
                break;
            case 'parametre-teams':
                return "bi bi-person-fill-gear";
                break;
            case 'historique':
                return "bi bi-list-columns-reverse";
                break;
            case 'parametres':
                return "bi bi-gear-fill";
                break;
            case 'tags':
                return "bi bi-tags-fill";
                break;
            case 'maj':
                return "bi bi-git";
                break;
            default:
                return $_type;
                break;
        }
    }
    
    public static function getFont(?array $_config = NULL){
        $tmp = '<i class="';
        if(!empty($_config["type"])){ $tmp .= self::types($_config["type"]) . ' '; }
        elseif(!empty($_config["icon"])){ $tmp .= $_config["icon"] . ' '; }
        else{ $tmp .= 'bi bi-braces-asterisk '; }
        if(!empty($_config["class"])){ $tmp .= ' ' . $_config["class"]; }
        $tmp .= '" style="';
        if(!empty($_config["color"])){ $tmp .= 'color: ' . $_config["color"] . ';'; }
        if(!empty($_config["size"])){ $tmp .= 'font-size: ' . $_config["size"] . ';'; }
        if(!empty($_config["style"])){ $tmp .= $_config["style"]; }
        $tmp .= '" ';
        $tmp .= '></i>';
        return $tmp;
    }
}