Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
1.4 KB
Raw Blame
<%= render DS::Card.new(class: "gap-4", data: { testid: "optional-services" }) do %>
  <div>
    <h2 class="text-lg font-semibold text-primary"><%= t(".title") %></h2>
    <p class="mt-1 text-sm text-secondary"><%= t(".description") %></p>
  </div>

  <% services.each do |service| %>
    <%= render DS::Disclosure.new(data: { testid: "optional-service-#{service.key}" }) do |disclosure| %>
      <% disclosure.with_summary_content do %>
        <div class="flex items-center gap-2">
          <%= icon "chevron-right", class: "group-open:rotate-90 motion-safe:transition-transform" %>
          <span class="font-medium text-sm text-primary"><%= t(".services.#{service.key}.title") %></span>
        </div>
        <% unless service.status == :not_configured %>
          <%= render DS::Pill.new(label: t(".statuses.#{service.status}"), tone: service.tone, marker: false) %>
        <% end %>
      <% end %>

      <div class="space-y-2 px-3 text-sm text-secondary">
        <p><%= t(".services.#{service.key}.description") %></p>
        <% service.notes.each do |note| %>
          <p><%= configuration_health_text(t(".notes.#{note}")) %></p>
        <% end %>
        <% if service.settings.any? %>
          <p><%= configuration_health_text(t(".missing_settings", settings: service.settings.join(", "))) %></p>
        <% end %>
        <p><%= configuration_health_text(t(".services.#{service.key}.guidance")) %></p>
      </div>
    <% end %>
  <% end %>
<% end %>