Class: InnerPlan::Groups::ShowMenuComponent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Phlex::Rails::Helpers::LinkTo
Defined in:
app/components/inner_plan/groups/show_menu_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(group) ⇒ ShowMenuComponent

Returns a new instance of ShowMenuComponent.



5
6
7
# File 'app/components/inner_plan/groups/show_menu_component.rb', line 5

def initialize(group)
  @group = group
end

Instance Method Details

#templateObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/components/inner_plan/groups/show_menu_component.rb', line 9

def template
  div(class: "dropdown") {
    button(class: "btn btn-link text-reset p-0 opacity-50", data_bs_toggle: "dropdown") {
      render(Phlex::Icons::Tabler::DotsCircleHorizontal.new(width: 35, height: 35))
    }

    ul(class: "dropdown-menu dropdown-menu-end") {
      li {
        link_to(helpers.edit_group_path(@group), class: 'dropdown-item d-flex align-items-center gap-2', data: { turbo_frame: :_top }) {
          render(Phlex::Icons::Tabler::Pencil.new(width: 18, height: 18, class: 'text-secondary'))
          span { "Edit group" }
        }
      }
    }
  }
end