PhoenixKitProjects.Web.Components.DerivedStatusBadge (PhoenixKitProjects v0.12.0)

Copy Markdown View Source

Badge that renders a project's Project.derived_status/1 value as a daisyUI badge with the canonical icon + color + gettext'd label.

Used in ProjectsLive (list view) but ready for reuse anywhere a project's lifecycle state needs a one-glance indicator.

Example

<.derived_status_badge state={Project.derived_status(project)} />

Summary

Functions

Convenience wrapper for the common pattern of badge'ing a project struct.

Badge for a project's user-defined workflow status (the entities-backed status, distinct from the computed derived_status).

Functions

derived_status_badge(assigns)

Attributes

  • state (:atom) (required) - Must be one of :running, :completed, :overdue, :scheduled, :setup, :archived, or :template.

project_status_badge(assigns)

Convenience wrapper for the common pattern of badge'ing a project struct.

Attributes

workflow_status_badge(assigns)

Badge for a project's user-defined workflow status (the entities-backed status, distinct from the computed derived_status).

Takes the normalized status map (%{label, color}) from PhoenixKitProjects.Statuses or nil. nil renders nothing — which is what makes a project with no status set (or an unavailable entities module) render cleanly empty. Uses the status's free-form color (a hex string) as an inline style, falling back to badge-neutral when no colour is set.

Attributes

  • status (:map) - Defaults to nil.
  • class (:string) - Defaults to nil.