<% content_for :title, "#{action.capitalize} #{@user.name.presence || @user.email}’s account" %>
<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %>

<%= @user.name %> Are you sure you want to <%= action %> this user?

<% if action == "deactivate" %>

Deactivating this user will mean they can no longer access this service to submit CORE data.

Any logs this user has already submitted will not be affected.

<% end %> <% active_value = action != "deactivate" %> <%= f.hidden_field :active, value: active_value %> <%= f.govuk_submit "I’m sure – #{action} this user", warning: action == "deactivate" %>

<%= govuk_link_to("No – I’ve changed my mind", user_path(@user)) %>

<% end %>