<!-- User menu -->

%   use SrvMngr qw( getNavigation );
%   my %nav = %{SrvMngr->getNavigation( $c->languages(), 'U' )};

%    # Define a hash mapping headings to icons
%    my %icon_map = (
%        "Change password" => "bi-key",
%        "Logout"          => "bi-box-arrow-right",
%    );

    <li class="nav-header">USER</li>

    <li class="nav-item">
        <a href='#' class="nav-link">
        <i class="nav-icon bi bi-person-fill"></i>Current User: <%= session 'username' %>
        </a>
    </li>

    %    my $cc = 300;
    %    foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
    %       <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {

    %       my ($classNew, $target, $href) = '';
    %       foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} }  @{$nav{$h}{'DESCRIPTIONS'}}) {
    %       next if ($_->{'MENUCAT'} ne 'U' );  # menu User
    %       if ( $_->{'FILENAME'} =~ m/^2\// ) {
    %           $target = '_self';
    %           (my $file2 = $_->{'FILENAME'}) =~ s|^2/||;
    %           $href = '/smanager/' . $file2;
    %       } else {
    %           $target = 'main';
    %           $href = '/server-manager' . $_->{'FILENAME'};
    %       }

    % # Retrieve the icon based on the value of $h
    % my $icon = $icon_map{$_->{'DESCRIPTION'}} // ""; # Default to an empty string if $h is not found

    <li class="nav-item">
        <a  target='<%= $target %>' href='<%= $href %>' class="nav-link">
        <i class="nav-icon bi <%= $icon %>"></i>
        <%= $_->{'DESCRIPTION'} %>
        </a>
    </li>

    %           $cc++;
    %      }
    %  }

