6 changed files with 24 additions and 26 deletions
@ -0,0 +1,7 @@
|
||||
<span class="govuk-!-margin-right-4"> |
||||
<% if searched.present? %> |
||||
<strong><%= count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total <%= item %>. <%= govuk_link_to("Clear search", request.path) %> |
||||
<% else %> |
||||
<strong><%= count %></strong> total <%= item %>. |
||||
<% end %> |
||||
</span> |
@ -0,0 +1,13 @@
|
||||
class ViewResultComponent < ViewComponent::Base |
||||
attr_reader :searched, :count, :item_label, :total_count, :item, :request |
||||
|
||||
def initialize(searched:, count:, item_label:, total_count:, item:, request:) |
||||
@searched = searched |
||||
@count = count |
||||
@item_label = item_label |
||||
@total_count = total_count |
||||
@item = item |
||||
@request = request |
||||
super |
||||
end |
||||
end |
Loading…
Reference in new issue