# typed: strict
# frozen_string_literal: true
module UiHelper
  extend T::Sig
  extend T::Helpers
  include HelpersInterface

  sig do
    params(
      title: String,
      collapsible: T::Boolean,
      initially_collapsed: T::Boolean,
      font_size_adjustable: T::Boolean,
      kwargs: T.untyped,
      block: T.proc.void,
    ).returns(String)
  end
  def sky_section_tag(
    title,
    collapsible: false,
    initially_collapsed: false,
    font_size_adjustable: false,
    **kwargs,
    &block
  )
    content = capture(&block)
    kwargs[:class] ||= "bg-slate-100 p-4"

    render(
      partial: "shared/section_controls/sky_section",
      locals: {
        title: title,
        content: content,
        collapsible: collapsible,
        initially_collapsed: initially_collapsed,
        font_size_adjustable: font_size_adjustable,
        container_class: kwargs[:class],
      },
    )
  end
end
