<%= t("users.registrations.edit.api_key.title") %>
<%= t("users.registrations.edit.api_key.description") %>
<% if current_user.api_key %>
<%= text_field_tag :api_key, current_user.api_key, class: "api-key-field", disabled: "disabled" %>
<% if current_user.api_key_expires_at < Time.current %>
<%= t("users.registrations.edit.api_key.expired") %>
<% end %>
<% end %>
<% if current_user.api_key %>
<%= button_to t("users.registrations.edit.api_key.regenerate"), users_api_key_regenerate_path, class: "btn btn-primary" %>
<%= button_to t("users.registrations.edit.api_key.revoke"), users_api_key_revoke_path, class: "btn btn-danger" %>
<% else %>
<%= button_to t("users.registrations.edit.api_key.generate"), users_api_key_regenerate_path, class: "btn btn-primary" %>
<% end %>