import type { ProviderQuotaResult } from "@paperclipai/shared"; import { formatDateTime } from "../lib/utils"; import { QuotaBar } from "./QuotaBar"; import { quotaUnavailableMessage } from "../lib/quota-refresh"; export function AccountQuotaPanels({ accounts, failed, }: { accounts: ProviderQuotaResult[]; failed?: boolean; }) { return (
{account.accountLabel ?? "Subscription account"}
{(failed || !account.ok) && ({account.errorFamily === "credentials_unavailable" ? "Connect or reconnect a subscription in AI connections to view its quota." : quotaUnavailableMessage(account.windows.length > 0)}
)} {account.windows.map((window, index) => window.usedPercent == null ? (Resets {formatDateTime(window.resetsAt)}
}Last checked {formatDateTime(account.capturedAt)}
)}