MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formatLastActive

Function formatLastActive

packages/react/src/pages/org.tsx:123–134  ·  view source on GitHub ↗
(lastActiveAt: string | null)

Source from the content-addressed store, hash-verified

121const GENERIC_INVITE_ERROR = "Failed to send invitation. Please try again.";
122
123function formatLastActive(lastActiveAt: string | null): string {
124 if (!lastActiveAt) return "—";
125 const date = new Date(lastActiveAt);
126 const diffMins = Math.floor((Date.now() - date.getTime()) / 60000);
127 if (diffMins < 1) return "Just now";
128 if (diffMins < 60) return `${diffMins}m ago`;
129 const diffHours = Math.floor(diffMins / 60);
130 if (diffHours < 24) return `${diffHours}h ago`;
131 const diffDays = Math.floor(diffHours / 24);
132 if (diffDays < 30) return `${diffDays}d ago`;
133 return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
134}
135
136export function OrgPage(props: {
137 domainsSection?: React.ReactNode;

Callers 1

OrgPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected