Allow disabling toggles, add toggle fieldset component

This commit is contained in:
Râu Cao
2023-03-12 13:41:36 +07:00
committed by Gitea
parent 805733939c
commit e758e258a8
5 changed files with 41 additions and 20 deletions
@@ -2,8 +2,9 @@
module FormElements
class ToggleComponent < ViewComponent::Base
def initialize(enabled:)
def initialize(enabled:, input_enabled: true)
@enabled = !!enabled
@input_enabled = input_enabled
end
end
end