File: composable_slots_component.rb

package info (click to toggle)
ruby-view-component 2.74.1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 3,156 kB
  • sloc: ruby: 6,731; sh: 163; javascript: 10; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class ComposableSlotsComponent < ViewComponent::Base
  delegate :title, to: :@parent

  def initialize
    @parent = SlotsV2WithoutContentBlockComponent.new
  end

  def call
    content_tag :div, class: "composable-slot-component" do
      capture do
        render @parent
      end
    end
  end
end