Files
nairobi/app/components/shared/recommended_index_component.rb
Javi Martín a548c497fc Move recommended index partial to a component
Thanks to it, we can slightly simplify the debates view rendering it.
2025-08-22 13:32:04 +02:00

15 lines
487 B
Ruby

class Shared::RecommendedIndexComponent < ApplicationComponent
attr_reader :recommended, :disable_recommendations_path, :namespace
use_helpers :recommended_path, :current_path_with_query_params
def initialize(recommended, disable_recommendations_path:, namespace:)
@recommended = recommended
@disable_recommendations_path = disable_recommendations_path
@namespace = namespace
end
def render?
feature?("user.recommendations") && recommended.present?
end
end