app/helpers/lookbook/component_helper.rb in lookbook-1.0.0 vs app/helpers/lookbook/component_helper.rb in lookbook-1.0.1

- old
+ new

@@ -4,9 +4,13 @@ def icon(name, **attrs) render Lookbook::Icon::Component.new(name: name, **attrs) end + def code(**attrs, &block) + render Lookbook::Code::Component.new(**attrs), &block + end + def render_component(ref, **attrs, &block) klass = component_class(ref) comp = attrs.key?(:content) ? klass.new(**attrs.except(:content)).with_content(attrs[:content]) : klass.new(**attrs) render comp, &block end