demarches-normaliennes/app/components/dsfr/toggle_component.rb
2024-05-30 17:50:08 +02:00

14 lines
469 B
Ruby

class Dsfr::ToggleComponent < ApplicationComponent
def initialize(form:, target:, title:, disabled: nil, hint: nil, toggle_labels: { checked: 'Activé', unchecked: 'Désactivé' }, opt: nil, extra_class_names: nil)
@form = form
@target = target
@title = title
@hint = hint
@disabled = disabled
@toggle_labels = toggle_labels
@opt = opt
@extra_class_names = extra_class_names
end
attr_reader :toggle_labels, :extra_class_names
end