AccrueAdmin.Components.WindowSelector (accrue_admin v1.4.0)

Copy Markdown View Source

Three-preset time window selector for analytics pages.

Renders a <nav> with three <.link patch> preset buttons ("7 days UTC", "30 days UTC", "90 days UTC") that update the ?window= URL param via LiveView client-side navigation. handle_params/3 fires automatically — no handle_event callback is needed in the parent LiveView.

Note on base_path

base_path may be a clean path or a path with existing query params. The component uses URI to safely replace the ?window= param, so any existing query string is correctly overwritten rather than producing a double-? URL.

Summary

Functions

window_selector(assigns)

Attributes

  • current_window (:string) (required)
  • base_path (:string) (required)