Class: Schemas::Sidebar

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

Instance Method Summary collapse

Constructor Details

#initializeSidebar

Returns a new instance of Sidebar.



8
9
# File 'app/components/databasium/schemas/sidebar.rb', line 8

def initialize
end

Instance Method Details

#view_templateObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/components/databasium/schemas/sidebar.rb', line 11

def view_template
  div(class: "flex flex-col gap-2", data: { controller: "search" }) do
    render Components::Databasium::Forms::Search.new(
             url: databasium.sidebar_schemas_path,
             turbo_frame: "results",
             placeholder: "Search for a model"
           )
    turbo_frame_tag("results", src: databasium.sidebar_schemas_path) do
      p(class: "mt-2 animate-pulse") { "Loading models..." }
    end
  end
end