PhoenixKitWeb.Components.Core.InvoiceStatusBadge (phoenix_kit v1.7.42)

Copy Markdown View Source

Provides invoice status badge components for the billing system.

Supports all invoice lifecycle statuses with appropriate color coding. Follows daisyUI badge styling conventions.

Summary

Functions

Renders an invoice status badge with appropriate styling.

Functions

invoice_status_badge(assigns)

Renders an invoice status badge with appropriate styling.

Attributes

  • status - Invoice status string (required)
  • size - Badge size: :xs, :sm, :md, :lg (default: :sm)
  • class - Additional CSS classes

Supported Statuses

  • draft - Invoice in draft state (ghost/gray)
  • sent - Invoice sent to customer (info/blue)
  • paid - Invoice paid successfully (success/green)
  • void - Invoice voided (error/red)
  • overdue - Invoice payment overdue (warning/yellow)

Examples

<.invoice_status_badge status="paid" />
<.invoice_status_badge status="overdue" size={:md} />
<.invoice_status_badge status={@invoice.status} class="ml-2" />

Attributes

  • status (:string) (required)
  • size (:atom) - Defaults to :sm. Must be one of :xs, :sm, :md, or :lg.
  • class (:string) - Defaults to "".