fix(usage): make unavailable account limits more visible (#10601)

This commit is contained in:
Dominic Roy authored and GitHub committed 2026-09-12 20:30:05 -03:00
1 parent af2baccd10
commit fcbe45796a
2 files changed
+36 -16

No files matched your search

@@ -10,7 +10,7 @@ import {
type LimitPoolWindow,
remainingPercent,
} from "@t3tools/shared/usageLimits";
import { TicketIcon } from "lucide-react";
import { AlertTriangleIcon, TicketIcon } from "lucide-react";
import { type ReactNode, useState } from "react";
import { usePrimarySettings } from "../../hooks/useSettings";
@@ -20,6 +20,7 @@ import { ProviderInstanceIcon } from "../chat/ProviderInstanceIcon";
import { getDriverOption } from "../settings/providerDriverMeta";
import { RedactedSensitiveText } from "../settings/RedactedSensitiveText";
import { Button } from "../ui/button";
import { Alert, AlertTitle } from "../ui/alert";
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
import {
PaceIcon,
@@ -545,7 +546,7 @@ export function UsageLimitsPooled({
const notices = collectLimitNotices(presentations);
return (
<div className="flex flex-col gap-8">
{pools.length === 0 ? (
{pools.length === 0 && notices.length === 0 ? (
<p className="text-sm text-muted-foreground">
No provider on the selected environments reports subscription limits.
</p>
@@ -562,10 +563,13 @@ export function UsageLimitsPooled({
function LimitNotices({ notices }: { readonly notices: readonly string[] }) {
if (notices.length === 0) return null;
return (
<ul className="flex flex-col gap-1 text-xs text-muted-foreground">
<Alert variant="warning" controlAlignment="first-line">
<AlertTriangleIcon />
{notices.map((notice) => (
<li key={notice}>{notice}</li>
<AlertTitle key={notice} className="break-words">
{notice}
</AlertTitle>
))}
</ul>
</Alert>
);
}