<.header> {t_auth("Account Settings")} <:subtitle>{t_auth("Manage your account email address and password settings")}
<.form :let={f} for={@email_changeset} action={~p"/users/settings"} id="update_email"> <.input field={f[:email]} type="email" label={t_auth("Email")} autocomplete="email" required /> <.button variant="primary" phx-disable-with={t_auth("Changing...")}> {t_auth("Change Email")}
<.form :let={f} for={@password_changeset} action={~p"/users/settings"} id="update_password"> <.input field={f[:password]} type="password" label={t_auth("New password")} autocomplete="new-password" required /> <.input field={f[:password_confirmation]} type="password" label={t_auth("Confirm new password")} autocomplete="new-password" required /> <.button variant="primary" phx-disable-with={t_auth("Changing...")}> {t_auth("Save Password")}

{t_auth("Alert Notification Devices")}

{t_auth("Manage mobile devices that receive push notifications for alerts")}

<%= if Enum.empty?(@mobile_sessions) do %>
<.icon name="hero-device-phone-mobile" class="mx-auto h-12 w-12 text-cool-steel-400" />

{t_auth("No mobile devices registered")}

{t_auth("Add a mobile device to receive push notifications for alerts")}

<% else %>
<%= for session <- @mobile_sessions do %>
<.icon name="hero-device-phone-mobile" class="h-5 w-5 text-cool-steel-400" />

{session.device_name || t_auth("Unknown Device")}

{session.device_os} • {session.app_version}

{t_auth("Last used %{date}", date: ToweropsWeb.TimeHelpers.format_date(session.last_used_at, "UTC") )}

<.form :let={_f} for={%{}} action={~p"/users/settings"} method="put" class="inline" > <.form :let={_f} for={%{}} action={~p"/users/settings"} method="put" class="inline" >
<% end %>
<% end %> <.link navigate={~p"/mobile/qr-login"} class="inline-flex items-center gap-2 rounded-lg bg-cool-steel-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-cool-steel-700 dark:bg-cool-steel-50 dark:text-cool-steel-900 dark:hover:bg-cool-steel-300" > <.icon name="hero-qr-code" class="h-4 w-4" /> {t_auth("Add Mobile Device")}