Class: Migrations::Sidebar

Inherits:
Components::Base
  • Object
show all
Includes:
Phlex::Rails::Helpers::ButtonTo, Phlex::Rails::Helpers::FormWith, Phlex::Rails::Helpers::LinkTo, Phlex::Rails::Helpers::TurboFrameTag
Defined in:
app/components/databasium/migrations/sidebar.rb

Instance Method Summary collapse

Constructor Details

#initializeSidebar

Returns a new instance of Sidebar.



11
12
# File 'app/components/databasium/migrations/sidebar.rb', line 11

def initialize
end

Instance Method Details

#view_templateObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/components/databasium/migrations/sidebar.rb', line 14

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