Remove duplication in cards tables
We were using the same code in two places, so we're extracting the code into a component in order to share it.
This commit is contained in:
8
app/components/admin/widget/cards/table_component.rb
Normal file
8
app/components/admin/widget/cards/table_component.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class Admin::Widget::Cards::TableComponent < ApplicationComponent
|
||||
attr_reader :cards, :no_cards_message
|
||||
|
||||
def initialize(cards, no_cards_message:)
|
||||
@cards = cards
|
||||
@no_cards_message = no_cards_message
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user