# frozen_string_literal: true module FormElements class FieldsetToggleComponent < ViewComponent::Base def initialize(tag: "li", form: nil, attribute: nil, field_name: nil, enabled: false, input_enabled: true, title:, description:) @tag = tag @form = form @attribute = attribute @field_name = field_name @form_enabled = @form.present? || @field_name.present? @enabled = enabled @input_enabled = input_enabled @title = title @descripton = description @button_text = @enabled ? "Switch off" : "Switch on" end end end