defmodule PlausibleWeb.Components.FirstDashboardLaunchBanner do @moduledoc """ A banner that appears on the first dashboard launch """ use PlausibleWeb, :component attr(:site, Plausible.Site, required: true) def set(assigns) do ~H""" """ end attr(:site, Plausible.Site, required: true) def render(assigns) do ~H""" """ end defp x_data(site) do "{show: !!sessionStorage.getItem('#{storage_key(site)}')}" end defp x_init(site) do "setTimeout(() => sessionStorage.removeItem('#{storage_key(site)}'), 3000)" end defp storage_key(site) do "dashboard_seen_#{site.domain}" end end