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