refactor(member-live): modularize the overview and drop the superseded in-memory paths

Extract the cookie parser, export-payload builder and fee-status helper
into their own modules and remove the filter/sort/load helpers the
database pushdown made dead, so the overview LiveView stays a thin
coordinator over focused units.
This commit is contained in:
Simon 2026-07-06 10:54:09 +02:00
parent c2cb3edab8
commit 77fc11a0b0
17 changed files with 375 additions and 875 deletions

View file

@ -143,12 +143,18 @@ defmodule MvWeb.CoreComponents do
attr :size, :string, values: ~w(sm md lg), default: "md"
attr :disabled, :boolean, default: false, doc: "Whether the button is disabled"
attr :active, :boolean,
default: false,
doc: "Renders the button in its active/pressed (toggled-on) state"
slot :inner_block, required: true
def button(assigns) do
rest = assigns.rest
variant = assigns[:variant] || "primary"
size = assigns[:size] || "md"
active_class = if assigns[:active], do: "btn-active", else: ""
variant_classes = %{
"primary" => "btn-primary",
@ -169,7 +175,9 @@ defmodule MvWeb.CoreComponents do
base_class = Map.fetch!(variant_classes, variant)
size_class = size_classes[size]
btn_class = [base_class, size_class] |> Enum.reject(&(&1 == "")) |> Enum.join(" ")
btn_class =
[base_class, size_class, active_class] |> Enum.reject(&(&1 == "")) |> Enum.join(" ")
assigns =
assigns
@ -214,6 +222,27 @@ defmodule MvWeb.CoreComponents do
end
end
@doc """
Renders a loading spinner for inline "busy" states.
Wraps the DaisyUI `loading` classes so views never spell them out. Mark it
`aria-hidden="true"` when an adjacent text label already conveys the busy state.
## Examples
<.spinner />
<.spinner size="lg" aria-hidden="true" />
"""
attr :size, :string, values: ~w(xs sm md lg), default: "sm"
attr :class, :any, default: nil, doc: "Additional layout classes"
attr :rest, :global
def spinner(assigns) do
~H"""
<span class={["loading loading-spinner", "loading-#{@size}", @class]} {@rest}></span>
"""
end
@doc """
Renders a non-interactive badge with WCAG-compliant contrast.