require_relative '<%= classify(name) %>_action'

module Voom

module Presenters
  module Plugins
    module <%= classify(name) %>
      # Event Actions are methods that appear inside an event block.
      # They do something on the (web) client and require code written for the client.
      # Name this actionJs method whatever you want
      # The data for this actionJs is rendered into the DOM using the file:
      #   web_client/components/actions/<%= classify(name) %>_data.rb
      # The javascript that performs the actionJs is defined in the file:
      #   views/js/components/actions/<%= classify(name) %>_action.js
      module DSLEventActions
        def <%= underscore(name) %>_action(text, **attributes, &block)
          self << <%= classify(name) %>::<%= classify(name) %>Action.new(text: text, parent: self, **attributes, &block)
        end
      end
    end
  end
end

end