Class: Records::Sidebar

Inherits:
Components::Base
  • Object
show all
Includes:
Phlex::Rails::Helpers::TurboFrameTag
Defined in:
app/components/databasium/records/sidebar.rb

Instance Method Summary collapse

Constructor Details

#initializeSidebar

Returns a new instance of Sidebar.



6
7
# File 'app/components/databasium/records/sidebar.rb', line 6

def initialize
end

Instance Method Details

#view_templateObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/components/databasium/records/sidebar.rb', line 9

def view_template
  div(class: "flex flex-col w-full") do
    render Components::Databasium::Forms::Search.new(
             url: databasium.sidebar_records_path,
             turbo_frame: "results",
             placeholder: "Search for a table"
           )
    turbo_frame_tag("results", src: databasium.sidebar_records_path) do
      p(class: "mt-2 animate-pulse") { "Loading tables..." }
    end
  end
end