defmodule ToweropsWeb.Components.ConsentPrompt do @moduledoc """ LiveView component for prompting users to re-consent when policies are updated. This component displays a modal that users cannot dismiss until they accept the updated privacy policy and/or terms of service. """ use Phoenix.Component use Gettext, backend: ToweropsWeb.Gettext import ToweropsWeb.CoreComponents attr :user_id, :string, required: true attr :policies, :list, required: true def consent_modal(assigns) do ~H""" <%= if @policies != [] do %> <% end %> """ end defp policy_name("privacy_policy"), do: gettext("Privacy Policy") defp policy_name("terms_of_service"), do: gettext("Terms of Service") defp policy_name(_), do: gettext("Policy") defp policy_link("privacy_policy"), do: "/privacy" defp policy_link("terms_of_service"), do: "/terms" defp policy_link(_), do: "/" end