<%= content_for :page_title, t(".page_title") %> <%= settings_section title: t(".success_title"), subtitle: t(".success_description") do %>
<%= render DS::FilledIcon.new( icon: "check-circle", rounded: true, size: "lg", variant: :success ) %>

<%= t(".success_title") %>

<%= t(".key_ready", name: @api_key.name) %>

<%= t(".your_api_key") %>

<%= t(".copy_store_securely") %>

<%= @api_key.plain_key %> <%= render DS::Button.new( text: t(".copy_key"), variant: "ghost", icon: "copy", data: { action: "clipboard#copy" } ) %>

<%= t(".key_details_title") %>

<%= t(".key_name_label") %> <%= @api_key.name %>
<%= t(".permissions_label") %> <%= @api_key.scopes.map { |scope| case scope when "read_accounts" then t("settings.api_keys_controller.scope_descriptions.read_accounts") when "read_transactions" then t("settings.api_keys_controller.scope_descriptions.read_transactions") when "read_balances" then t("settings.api_keys_controller.scope_descriptions.read_balances") when "write_transactions" then t("settings.api_keys_controller.scope_descriptions.write_transactions") else scope.humanize end }.join(", ") %>
<%= t(".created_label") %> <%= @api_key.created_at.strftime("%B %d, %Y at %I:%M %p") %>
<%= render DS::Alert.new(title: t(".security_note_title"), variant: :warning) do %>

<%= t(".security_note_body") %>

<% end %>

<%= t(".usage_instructions_title") %>

<%= t("settings.api_keys.show.current_api_key.usage_instructions", product_name: product_name) %>

curl -H "X-Api-Key: <%= @api_key.plain_key %>" <%= request.base_url %>/api/v1/accounts
<%= render DS::Link.new( text: t(".continue"), href: settings_api_key_path, variant: "primary" ) %>
<% end %>