BathHacked/energy-sparks

View on GitHub
app/components/info_bar_component/info_bar_component.html.erb

Summary

Maintainability
Test Coverage
<%= component 'notice', status: status, classes: classes, style: style do %>
  <div class="row align-items-center">
    <% if icon %>
      <div class="col-md-<%= icon_cols %> d-flex justify-content-center align-content-center flex-wrap">
        <%= icon %>
      </div>
    <% end %>
    <% if buttons.present? %>
      <div class='<%= "col-md-#{base_columns - buttons.size * 2}" %>'>
        <%= title %>
      </div>
      <% buttons.each do |title, path| %>
        <div class="col-md-2 d-flex justify-content-end">
          <%= link_to sanitize(title), path, class: "btn btn-light btn rounded-pill font-weight-bold", style: 'height: fit-content;' %>
        </div>
      <% end %>
    <% else %>
      <div class="col-md-<%= base_columns %>">
        <h5><%= title %></h5>
      </div>
    <% end %>
  </div>
<% end %>