AyuntamientoMadrid/participacion

View on GitHub
app/components/admin/widget/cards/table_component.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Admin::Widget::Cards::TableComponent < ApplicationComponent
  attr_reader :cards, :no_cards_message, :options

  def initialize(cards, no_cards_message:, **options)
    @cards = cards
    @no_cards_message = no_cards_message
    @options = options
  end

  private

    def attribute_name(attribute)
      ::Widget::Card.human_attribute_name(attribute)
    end

    def header_section?
      cards.first.header_or_sdg_header?
    end
end