18F/identity-idp

View on GitHub
app/views/shared/_troubleshooting_options.html.erb

Summary

Maintainability
Test Coverage
<%#
locals:
* heading_tag: Tag name for heading. Does not affect visual appearance. Defaults to :h2.
* heading: Heading text.
* options: List of link options to display, as an array of hashes with `url`, `text`, `new_tab` values.
* class: Additional class names to add to wrapper element.
%>
<%= render TroubleshootingOptionsComponent.new(class: local_assigns[:class]) do |c| %>
  <% c.with_header(heading_level: local_assigns[:heading_tag] || :h2).with_content(heading) %>
  <% options.each { |option| c.with_option(**option.except(:text)).with_content(option[:text]) } %>
<% end %>