<div>

    <br>

    <form action="/smanager/printers" method="POST">

        % my $btn = l('prt_INITIAL_BTN');
        <%= hidden_field 'trt' => 'ADD' %>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
            </div>
        </div>
    </form>

    <br>

    <h2><%= l 'prt_CURRENT_LIST' %></h2>
    <br><br>

    % my $numPrinters = @$printerDrivers;
    % if ($numPrinters == 0){
          <%= l 'prt_NO_PRINTERS' %>
    % } else {
            <table class="table table-bordered">
               <thead>
                   <tr>
                           <th><%= l 'NAME' %></th>
                           <th><%= l 'DESCRIPTION' %></th>
                           <th><%= l 'LOCATION' %></th>
                           <th><%= l 'prt_REMOTE_ADDRESS' %></th>
                           <th><%= l 'prt_REMOTE_NAME' %></th>
                           <th><%= l 'ACTION' %></th>
                   </tr>
                   </thead>
                <tbody>
                % foreach my $printer (@$printerDrivers) {
                %     my $address = ($printer->prop('Location') eq 'remote')
                %     ? $printer->prop('Address') : 'N/A';
                %     my $remoteName = ($printer->prop('Location') eq 'remote')
                %     ? $printer->prop('RemoteName') : 'N/A';
                %     $remoteName = 'raw' unless ($remoteName);

                    <tr class="align-middle">
                        <td><%= $printer->key %></td>
                        <td><%= $printer->prop('Description') %></td>
                        <td><%= $printer->prop('Location') %></td>
                        <td><%= $address %></td>
                        <td><%= $remoteName %></td>
                        <td>
                            % my $remove_text = l('REMOVE');  # Localized text
                            % my $csrf_token = "TOKEN";  # CSRF token for security
                            % my $printer_name = $printer->key;
                            % my $actionRemove = qq{
                            % <a href="printers2?CsrfDef=$csrf_token&trt=DEL&&printer=$printer_name">
                            %   <button type='button' class="btn btn-primary btn-sm" title='$remove_text' >
                            %   $remove_text
                            %   </button>
                            % </a>
                            % };
                            <%= $c->render_to_string(inline => $actionRemove) %>
                        </td>
                    </tr>
                % }
                </tbody>
            </table>
    % }



</div>
