Sha256: 8a348875be82e679a40460a1c3def5472dcbe11110b4a208cc0e106b8604d6df

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

module RailsDevtools
  class DatabaseTables::Index < ApplicationView
    def initialize(form: nil, tables: [])
      @tables = tables
      @form = form
    end

    def view_template
      render Components::PageContent.new do |page|
        page.page_title { "Database tables" }
        page.search_form(form: @form, path: helpers.database_tables_path)
        page.results { results }
      end
    end

    private

    def results
      if @tables.empty?
        div(class: "text-neutral") { "No results found" }
      else
        div(class: "grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 3xl:grid-cols-4 gap-2 w-full items-start") do
          @tables.each do |table|
            render DatabaseTables::TableCard.new(table: table)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_devtools-0.1.3 app/views/rails_devtools/database_tables/index.rb
rails_devtools-0.1.2 app/views/rails_devtools/database_tables/index.rb
rails_devtools-0.1.1 app/views/rails_devtools/database_tables/index.rb
rails_devtools-0.1.0 app/views/rails_devtools/database_tables/index.rb