<% title = @scheme.service_name %>
<% content_for :title, title %>

<% content_for :before_content do %>
  <%= govuk_back_link(
    text: "Back",
    href: "/schemes",
  ) %>
<% end %>

<%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %>

<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %>

<h2 class="govuk-visually-hidden">Scheme</h2>

<%= govuk_summary_list do |summary_list| %>
  <% display_attributes(@scheme).each do |attr| %>
    <% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %>
    <%= summary_list.row do |row| %>
      <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %>
      <% row.value { details_html(attr) } %>
      <% row.action(text: "Change", href: scheme_edit_name_path(scheme_id: @scheme.id)) if attr[:edit] %>
    <% end %>
  <% end %>
<% end %>

<% if FeatureToggle.scheme_toggle_enabled? %>
  <% if @scheme.status == :active %>
    <%= govuk_button_link_to "Deactivate this scheme", scheme_deactivate_path(@scheme), warning: true %>
  <% else %>
    <%= govuk_button_link_to "Reactivate this scheme", scheme_reactivate_path(@scheme) %>
  <% end %><% end %>