Files
nairobi/app/components/moderation/users/index_component.rb
Javi Martín 26a43ee0d2 Add a proper title to moderation index pages
Since this is already a component, we can use the `header` method
without much refactoring.
2024-06-06 16:09:18 +02:00

23 lines
450 B
Ruby

class Moderation::Users::IndexComponent < ApplicationComponent
include Header
attr_reader :users
def initialize(users)
@users = users
end
private
def title
t("moderation.users.index.title")
end
def status(user)
t("admin.activity.show.actions.#{activity_action(user)}")
end
def activity_action(user)
Activity.where(actionable: user, action: [:hide, :block]).last&.action || "block"
end
end