<?php

namespace App\Twig\Components;

use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent]
class Role
{
    public array $roles;

    public function getRole(): string
    {
        if (in_array('ROLE_ADMIN', $this->roles, true)) {
            return 'Administrateur';
        } elseif (in_array('ROLE_MANAGER', $this->roles, true)) {
            return 'Gestionnaire';
        } elseif (in_array('ROLE_STAFF', $this->roles, true)) {
            return 'Equipe';
        } elseif (in_array('ROLE_USER', $this->roles, true)) {
            return 'Participant';
        }

        return 'Inconnu';
    }
}

