module Voom

module Presenters
  module Plugins
    module <%= classify(name) %>
      module WebClientComponents
        def render_<%= underscore(name) %>(comp,render:, components:, index:)
          view_dir = File.join(__dir__, '../../../../../../..', 'views', 'components')
          render.call :erb, :<%= underscore(name) %>, views: view_dir,
                      locals: {comp: comp,
                      components: components, index: index}
        end
        # The string returned from this method will be added to the HTML header section of the page layout
        # It will be called once for the page.
        # The pom is passed along with the sinatra render method.
        def render_header_<%= underscore(name) %>(_pom, render:)
          view_dir = File.join(__dir__, '../../../../../../..', 'views', 'components')
          render.call :erb, :<%= underscore(name) %>_header, views: view_dir
        end
      end
    end
  end
end

end