%h5.mt-2.text-light= list_title
- if @items.any?
  - @items.each do |item|
    - case @class_name
      - when 'Package'
        - name = "#{item.project}/#{item}"
        .d-flex.flex-row.flex-wrap.align-items-baseline
          = link_to(package_show_path(item.project, item), class: 'd-flex flex-row flex-wrap align-items-baseline') do
            %i.fas.fa-archive.me-1
            - name.split(%r{(/)}).each_slice(2).map(&:join).map(&:strip).each do |slice|
              %span.d-inline
                = slice
          = link_to('#', class: 'ms-auto',
                    data: { 'bs-toggle': 'modal',
                            'bs-target': '#delete-item-from-watchlist-modal',
                            modal_title: 'Do you really want to remove this package from the watchlist?',
                            confirmation_text: "Please confirm you want to remove '#{name}' from the watchlist.",
                            action: project_package_toggle_watched_item_path(project_name: item.project.name,
                                                                             package_name: item.name,
                                                                             current_object: current_object_params) }) do
            %i.fa.fa-times-circle{ title: 'Remove package from watchlist' }
      - when 'Project'
        - name = item.name
        .d-flex.flex-row.flex-wrap.align-items-baseline
          = link_to(project_show_path(item), class: 'd-flex flex-row flex-wrap align-items-baseline') do
            %i.fas.fa-cubes.me-1
            - name.split(/(:)/).each_slice(2).map(&:join).map(&:strip).each do |slice|
              %span.d-inline
                = slice
          = link_to('#', class: 'ms-auto',
                    data: { 'bs-toggle': 'modal',
                            'bs-target': '#delete-item-from-watchlist-modal',
                            modal_title: 'Do you really want to remove this project from the watchlist?',
                            confirmation_text: "Please confirm you want to remove '#{name}' from the watchlist.",
                            action: project_toggle_watched_item_path(project_name: name, current_object: current_object_params) }) do
            %i.fa.fa-times-circle{ title: 'Remove project from watchlist' }
      - when 'BsRequest'
        - name = "##{item.number} #{helpers.request_type_of_action(item)}"
        .d-flex.flex-row.flex-wrap.align-items-baseline.collapsible-tooltip-parent
          = link_to(request_show_path(item.number), class: 'text-word-break-all') do
            = render BsRequestStateBadgeComponent.new(state: item.state)
            = name
          %i.fa.fa-question-circle.px-2.collapsible-tooltip{ title: 'Click to keep it open' }
          = link_to('#', class: 'ms-auto',
                    data: { 'bs-toggle': 'modal',
                            'bs-target': '#delete-item-from-watchlist-modal',
                            modal_title: 'Do you really want to remove this request from the watchlist?',
                            confirmation_text: "Please confirm you want to remove '#{name}' from the watchlist.",
                            action: toggle_watched_item_request_path(number: item.number, current_object: current_object_params) }) do
            %i.fa.fa-times-circle{ title: 'Remove request from watchlist' }
        .extended-info.mt-2.mb-3.collapsed
          .triangle.left
          .extended-info-content
            %p.px-2.pt-2= render(BsRequestActionSourceAndTargetComponent.new(item))
- else
  %p= empty_list_text
