PhoenixKitProjects.Web.Components.RunningCard (PhoenixKitProjects v0.3.0)

Copy Markdown View Source

One row in the dashboard's "Running" section — clickable link wrapping a title, tier pill, started-X-ago metadata, done/total counts, an in-progress note, and a colored progress bar.

Driven by the project_summary map shape returned by Projects.project_summaries/1:

%{
  project: %Project{},
  total: integer,
  done: integer,
  in_progress: integer,
  progress_pct: integer,
  total_hours: number,
  planned_end: DateTime.t() | nil
}

The caller passes the tier directly so the dashboard can reuse the same tier classifier it uses to sort + cap the list.

Example

<.running_card summary={s} tier={running_tier(s)} navigate={Paths.project(s.project.uuid)} lang={lang} />

Summary

Functions

running_card(assigns)

Attributes

  • summary (:map) (required)
  • tier (:atom) (required) - Must be one of :late, :near_done, :on_track, or :empty.
  • navigate (:string) (required)
  • emit (:any) - {TargetLV :: module(), session_overrides :: map()} — required when used in embed-mode callers; defaults to opening ProjectShowLive with the summary's project uuid. Defaults to nil.
  • embed_mode (:atom) - Defaults to :navigate. Must be one of :navigate, or :emit.
  • lang (:string) - Defaults to nil.