Skip to content

PaymentStatusTimeline

Submitted → sent → settled, with real timestamps.
Implemented
Status
Implemented
Family
3 of 13
Registry
@lopifi/payment-status-timeline
npx shadcn@latest add @lopifi/theme @lopifi/payment-status-timeline

The component, rendering

Real data, the shipped component. Switch the theme to check the claims the spec makes below.

Preview

The four-layer spec

Submitted → Sent → In transit → Settled, each with a real timestamp and timezone. Failed states show the reason and the remedy. Pending is a state, not a load — a clock icon, never a spinner.

Lifted verbatim from Payments. The doc and this page are the same paragraphs, so they cannot disagree.

What lands in your repository

One component is never one file. Everything below is copied into your project, where you own it.

Files

components/ledger/payment-status-timeline.tsx

Lopifi dependencies · 3
cnfiscal-periodicons
npm packages
clsxtailwind-merge
Registry entry
/r/payment-status-timeline.json

The whole component

No compiled bundle, no black box. This is the file the registry copies, and the file you will edit.

components/ledger/payment-status-timeline.tsx
import * as React from "react";
import { cn } from "@/lib/ledger/cn";
import { formatTimestamp } from "@/lib/ledger/fiscal-period";
import { CheckIcon, ClockIcon, ExclamationTriangleIcon } from "@/components/ledger/icons";

export type TimelineStep = {
  label: string;
  at: Date | null;
  state: "done" | "pending" | "failed";
  /** On failure: what happened and what to do about it. */
  reason?: string;
  remedy?: string;
};

export interface PaymentStatusTimelineProps extends React.ComponentPropsWithoutRef<"ol"> {
  steps: TimelineStep[];
  timeZone?: string;
}

/**
 * Submitted → Sent → In transit → Settled, each with a real timestamp and a
 * stated timezone. Pending is a state, not a load — a clock icon, never a
 * spinner.
 */
export const PaymentStatusTimeline = React.forwardRef<HTMLOListElement, PaymentStatusTimelineProps>(
  ({ className, steps, timeZone = "UTC", ...props }, ref) => (
    <ol className={cn("flex flex-col", className)} ref={ref} {...props}>
      {steps.map((step, i) => {
        const last = i === steps.length - 1;
        return (
          <li className="flex gap-3" key={step.label}>
            <div className="flex flex-col items-center">
              <span
                aria-hidden="true"
                className={cn(
                  "grid size-6 shrink-0 place-items-center rounded-full border",
                  step.state === "done" && "border-positive bg-positive-subtle text-positive",
                  step.state === "pending" && "border-border-strong text-text-tertiary",
                  step.state === "failed" && "border-negative bg-negative-subtle text-negative",
                )}
              >
                {step.state === "done" ? (
                  <CheckIcon className="size-3" />
                ) : step.state === "failed" ? (
                  <ExclamationTriangleIcon className="size-3" />
                ) : (
                  <ClockIcon className="size-3" />
                )}
              </span>
              {!last ? (
                <span
                  aria-hidden="true"
                  className={cn("w-px flex-1", step.state === "done" ? "bg-positive" : "bg-border")}
                />
              ) : null}
            </div>
            <div className={cn("pb-6", last && "pb-0")}>
              <p
                className={cn(
                  "text-body font-medium",
                  step.state === "pending" && "text-text-secondary",
                  step.state === "failed" && "text-negative",
                )}
              >
                {step.label}
              </p>
              {step.at ? (
                <p className="numeric text-caption text-text-tertiary">
                  {formatTimestamp(step.at, timeZone)}
                </p>
              ) : (
                <p className="text-caption text-text-tertiary">Not yet</p>
              )}
              {step.reason ? <p className="mt-1 text-caption text-text-secondary">{step.reason}</p> : null}
              {step.remedy ? (
                <p className="mt-1 text-caption font-medium text-text-primary">{step.remedy}</p>
              ) : null}
            </div>
          </li>
        );
      })}
    </ol>
  ),
);
PaymentStatusTimeline.displayName = "PaymentStatusTimeline";

The accounting it encodes

Concepts this component renders. Each one is defined once, in the lexicon, and used identically in the code and the copy.

Also in Payments

See also

A component is specified in one place, defined in another, and running in a third. All three, from here.

Elsewhere in the system

Where PaymentStatusTimeline sits in the rest of the system — the live section it renders in, the calculators that compute what it displays, and the ledger payloads it is fed from.

Components are copied into your repository and meant to be edited — rounding policy, fiscal calendar and compliance copy differ per company.

Told when Payments changes

Components are copied into your repo, so a fix here does not reach you on its own. One email when a component in this family changes in a way that needs a migration — and nothing when it does not.

One address, no list rental, unsubscribe in one click.

Works in your QuickBooks Online or Xero file

Get your books closed every month

Lopifi is building AI bookkeeping that keeps your books closed on US GAAP as transactions happen, with a CPA review every quarter, for $200 a month. We’re not open yet.

$200/month when we open. No card now.