demarches-normaliennes/app/components/dsfr/toggle_component.rb

17 lines
500 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2023-04-24 15:16:04 +02:00
class Dsfr::ToggleComponent < ApplicationComponent
2024-05-28 16:40:15 +02:00
def initialize(form:, target:, title:, disabled: nil, hint: nil, toggle_labels: { checked: 'Activé', unchecked: 'Désactivé' }, opt: nil, extra_class_names: nil)
2023-04-24 15:16:04 +02:00
@form = form
@target = target
@title = title
@hint = hint
@disabled = disabled
@toggle_labels = toggle_labels
@opt = opt
2024-05-28 16:40:15 +02:00
@extra_class_names = extra_class_names
2023-04-24 15:16:04 +02:00
end
2024-05-28 16:40:15 +02:00
attr_reader :toggle_labels, :extra_class_names
2023-04-24 15:16:04 +02:00
end