Skip to content
API reference

components/activity-line

Import
import * as api from "@fungi.computer/caps/components/activity-line";
Kind Export Description
type alias ActivityState Where a piece of agent work stands.
type alias ActivityLineProps Props accepted by ActivityLine.
function formatElapsed() Short elapsed time: 0.4s, 4.2s, 42s, 3m 05s.
function useElapsed() A clock that ticks while running and holds still otherwise. Times are epoch milliseconds (Date.now()), owned by the caller.
function ActivityLine() One line of agent activity. While running it says what is happening with a live clock and shows its trace; when done it settles into “Thought for 4.2s” and folds the trace away, one click from reopening.

ActivityStatetype alias

Section titled “ActivityState”
Signature
type ActivityState = "running" | "done" | "failed";

Where a piece of agent work stands.


ActivityLinePropstype alias

Section titled “ActivityLineProps”
Signature
type ActivityLineProps = Readonly<{
state: ActivityState;
startedAt: number;
finishedAt?: number;
label: string;
doneLabel: string;
failedLabel?: string;
children?: ReactNode;
className?: string;
}>;

Props accepted by ActivityLine.

formatElapsed()function

Section titled “formatElapsed()”
Signature
function formatElapsed(milliseconds): string;

Short elapsed time: 0.4s, 4.2s, 42s, 3m 05s.

Parameter Type
milliseconds number

string


useElapsed()function

Section titled “useElapsed()”
Signature
function useElapsed(startedAt, finishedAt, running): number;

A clock that ticks while running and holds still otherwise. Times are epoch milliseconds (Date.now()), owned by the caller.

Parameter Type
startedAt number
finishedAt number | undefined
running boolean

number


ActivityLine()function

Section titled “ActivityLine()”
Signature
function ActivityLine(__namedParameters): Element;

One line of agent activity. While running it says what is happening with a live clock and shows its trace; when done it settles into “Thought for 4.2s” and folds the trace away, one click from reopening.

Parameter Type
__namedParameters ActivityLineProps

Element