- staged_requests_size = staging_project.staged_requests.size
- can_delete_staging_project = staged_requests_size.zero?

.col-12.col-md-6.col-lg-4
  .card.mb-3
    .card-header.p-2
      .d-flex.w-100.justify-content-between
        .col-10.p-0
          = render StagingProjectLinkComponent.new(staging_project: staging_project, staging_workflow: staging_workflow)
        .col-2.p-0.text-end
          %span.me-1
            = link_to(preview_copy_staging_workflow_staging_project_path(staging_workflow.project, staging_project), title: 'Copy Staging Project') do
              %i.fas.fa-clone.text-secondary
            - if can_delete_staging_project
              = link_to('#', data: { 'bs-toggle': 'modal', 'bs-target': "#confirm-modal-#{staging_project.id}" },
                        title: "Delete #{staging_project}") do
                %i.fas.fa-times-circle.text-danger
            - else
              %i.fas.fa-times-circle.text-muted{ data: { 'bs-toggle': 'popover', 'bs-placement': 'bottom',
                                                'bs-content': 'This project can not be deleted because it has staged requests' } }
    .card-body.p-2.text-muted
      %small.d-block
        state:
        %strong= staging_project.overall_state
      %small.d-block
        requests:
        %strong= staged_requests_size
      - if can_delete_staging_project
        = render partial: 'delete_staging_project_modal', locals: { staging_workflow: staging_workflow, staging_project: staging_project }
