<div>

    % my $btn = l('GROUP_ADD');

    <form action="/smanager/groups2" method="POST">
        <br>
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary btn-sm"><%= $btn %> </button>
            </div>
        </div>
        <%= hidden_field 'trt' => 'ADD' %>
    </form>

    <br>
    <h2><%= l 'grp_CURRENT_LIST' %></h2>
    <br><br>
    % my $numGroups = @$groups;
    % if ($numGroups == 0){
        <%= l 'ACCOUNT_GROUP_NONE' %>
    % } else {
        <table class="table table-bordered user-table-max-width">
            <thead>
                <tr>
                    <th class="col-sm"><%= l 'GROUP' %></th>
                    <th class="col-sm"><%= l 'DESCRIPTION' %></th>
                    <th class="col-sm align-middle" colspan="2"><%= l 'ACTION' %></th>
                </tr>
            </thead>
            <tbody>
                % foreach my $group ( @$groups ) {
                    <tr>
                        <td><%= $group->key %></td>
                        <td><%= $group->prop('Description') %></td>

                            % my $csrf_token = "TOKEN";  # CSRF token for security
                            % my $group_name = $group->key;  # group name extracted from the data structure

                            % my $modify_text = l('MODIFY');  # Localized text
                            % my $actionModify = qq{
                                % <a href="groups2?CsrfDef=$csrf_token&trt=UPD&group=$group_name">
                                %   <button type='button' class="btn btn-primary btn-sm" title='$modify_text' >
                                %       $modify_text
                                %   </button>
                                % </a>
                            %};

                            % my $remove_text = l('REMOVE');  # Localized text
                            % my $actionRemove = qq{
                                % <a href="groups2?CsrfDef=$csrf_token&trt=DEL&group=$group_name">
                                %   <button type='button' class="btn btn-primary btn-sm" title='$remove_text' >
                                %       $remove_text
                                %   </button>
                                % </a>
                            %};

                        <td class="align-middle"><%= $c->render_to_string(inline => $actionModify) %></td>
                        <td class="align-middle"><%= $c->render_to_string(inline => $actionRemove) %></td>
                    </tr>
                % }
            </tbody>
        </table>
    % }

</div>
