<%= t("users.registrations.edit.api_key.title") %>

<%= t("users.registrations.edit.api_key.description") %>

<% if current_user.api_key %>
<%= password_field_tag :api_key, current_user.api_key, name: 'api_key', class: 'form-control sci-input-field !text-sn-black !font-mono !cursor-text', 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 mr-2" %> <%= 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 %>