<% provide :title, t("budgets.index.title") %>
<% provide :main_class, "budgets-index" %>

<%= render Shared::BannerComponent.new("budgets") %>

<% content_for :canonical do %>
  <%= render "shared/canonical", href: budgets_url %>
<% end %>

<% if @budget.present? %>
  <%= render Budgets::BudgetComponent.new(@budget) %>

  <% if @finished_budgets.present? %>
    <%= render "finished", budgets: @finished_budgets %>
  <% end %>
<% else %>
  <header>
    <h1><%= t("budgets.index.title") %></h1>
  </header>

  <div class="row">
    <div class="small-12 column">
      <div class="callout primary">
        <%= t("budgets.index.empty_budgets") %>
      </div>
    </div>
  </div>
<% end %>

<%= render Budgets::FooterComponent.new %>
