<%= if @subscription.next_bill_date && Timex.compare(@subscription.next_bill_date, Timex.today()) >= 0 do %>
Your subscription is cancelled but you have access to your stats until <%= Timex.format!(
@subscription.next_bill_date,
"{Mshort} {D}, {YYYY}"
) %>. Upgrade below to make sure you don't lose access.
<% else %>
Your subscription is cancelled. Upgrade below to get access to your stats again.
<% end %>
<%= button("Revoke",
to: "/settings/api-keys/#{api_key.id}",
class: "text-red-600 hover:text-red-900",
method: :delete,
"data-confirm":
"Are you sure you want to revoke this key? This action cannot be reversed."
) %>
<% end %>
<% end %>
<%= link("+ New API key", to: "/settings/api-keys/new", class: "button mt-4") %>
Delete account
Deleting your account removes all sites and stats you've collected
<%= if @subscription && @subscription.status == "active" do %>
Delete my account
Your account cannot be deleted because you have an active subscription. If you want to delete your account, please cancel your subscription first.
<% else %>
<%= link("Delete my account",
to: "/me",
class:
"inline-block mt-4 px-4 py-2 border border-gray-300 dark:border-gray-500 text-sm leading-5 font-medium rounded-md text-red-700 bg-white dark:bg-gray-800 hover:text-red-500 dark:hover:text-red-400 focus:outline-none focus:border-blue-300 focus:ring active:text-red-800 active:bg-gray-50 transition ease-in-out duration-150",
method: "delete",
data: [
confirm:
"Deleting your account will also delete all the sites and data that you own. This action cannot be reversed. Are you sure?"
]
) %>
<% end %>