Class: Panda::Core::Admin::ButtonComponent
- Inherits:
-
Base
- Object
- Phlex::HTML
- Base
- Panda::Core::Admin::ButtonComponent
show all
- Defined in:
- app/components/panda/core/admin/button_component.rb
Constant Summary
Constants inherited
from Base
Base::TAILWIND_MERGER
Instance Method Summary
collapse
Methods inherited from Base
#after_template, #attrs, #before_template, #merge_attrs, #tailwind_merge_attrs
Instance Method Details
#default_attrs ⇒ Object
24
25
26
27
28
29
30
|
# File 'app/components/panda/core/admin/button_component.rb', line 24
def default_attrs
{
href: @href,
class: button_classes,
id: @id
}
end
|
#view_template ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'app/components/panda/core/admin/button_component.rb', line 14
def view_template
a(**@attrs) do
if computed_icon
i(class: "mr-2 fa-solid fa-#{computed_icon}")
plain " "
end
plain @text.titleize
end
end
|