module Lookbook::ComponentHelper
def lookbook_render(ref, **attrs, &block)
def lookbook_render(ref, **attrs, &block) comp = if ref.is_a? ViewComponent::Base ref else klass = component_class(ref) attrs.key?(:content) ? klass.new(**attrs.except(:content)).with_content(attrs[:content]) : klass.new(**attrs) end if block && !attrs.key?(:content) public_send render_method_name, comp, &block else public_send render_method_name, comp end end