Sha256: b099b56b7a645855ef05936b8b9773dafe2ab5a3fd2c68ec646711e9388a170d
Contents?: true
Size: 702 Bytes
Versions: 13
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module Koi class IndexTableComponent < ViewComponent::Base attr_reader :id, :pagy_id # Use the Koi::Tables::TableComponent to support custom header and body row components renders_one :table, Koi::Tables::TableComponent renders_one :pagination, Katalyst::Turbo::PagyNavComponent def initialize(collection:, id: "index-table", **options) super @id = id @pagy_id = "#{id}-pagination" with_table(collection:, id:, class: "index-table", caption: true, **options) with_pagination(collection:, id: pagy_id) if collection.paginate? end def call concat(table) concat(pagination) end end end
Version data entries
13 entries across 13 versions & 1 rubygems