defmodule ToweropsWeb.Components.CookieConsent do @moduledoc """ Cookie consent banner component for GDPR compliance. Only displays to users from EU/EEA countries and for users who haven't yet accepted the cookie policy. Since we only use essential cookies (session, CSRF), the banner is informational and provides an "Acknowledge" button. """ use Phoenix.Component import ToweropsWeb.CoreComponents, only: [icon: 1] @doc """ Renders a cookie consent banner at the bottom of the page. ## Attributes * `requires_consent` - boolean, whether to show the banner (EU/EEA users) Note: The banner is always rendered if requires_consent is true. JavaScript will hide it immediately if the consent cookie exists. """ attr :requires_consent, :boolean, required: true def banner(assigns) do ~H""" <%= if @requires_consent do %>
<% end %> """ end end