Allow different labels in admin search component
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
class Admin::SearchComponent < ApplicationComponent
|
||||
attr_reader :url
|
||||
attr_reader :url, :label
|
||||
|
||||
def initialize(url:)
|
||||
def initialize(url:, label:)
|
||||
@url = url
|
||||
@label = label
|
||||
end
|
||||
|
||||
private
|
||||
@@ -10,8 +11,4 @@ class Admin::SearchComponent < ApplicationComponent
|
||||
def search_terms
|
||||
params[:search]
|
||||
end
|
||||
|
||||
def label
|
||||
t("admin.shared.user_search.placeholder")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%= render Admin::SearchComponent.new(url: url) %>
|
||||
<%= render Admin::SearchComponent.new(url: url, label: t("admin.shared.user_search.placeholder")) %>
|
||||
|
||||
Reference in New Issue
Block a user