Sha256: 036d879892b909e317fd0c86c943137abc887f05a4a4132f612b35374b9717cd

Contents?: true

Size: 476 Bytes

Versions: 9

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Navigation
    module Editor
      class NewItemsComponent < BaseComponent
        include ::Turbo::FramesHelper

        renders_many :items, Editor::NewItemComponent

        def items
          Katalyst::Navigation.config.items.map do |item_class|
            item_class = item_class.safe_constantize if item_class.is_a?(String)
            item_class.new(menu:)
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katalyst-navigation-1.8.4 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.8.3 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.8.2 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.8.1 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.8.0 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.6.0 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.5.2 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.5.1 app/components/katalyst/navigation/editor/new_items_component.rb
katalyst-navigation-1.5.0 app/components/katalyst/navigation/editor/new_items_component.rb