"use client"; import { IconAlertTriangle, IconLoader2, IconRefresh } from "@tabler/icons-react"; import { Badge } from "@kandev/ui/badge"; import { Button } from "@kandev/ui/button"; import { Card, CardContent } from "@kandev/ui/card"; import { Separator } from "@kandev/ui/separator"; import { cn } from "@/lib/utils"; import { AgentLogo } from "@/components/agent-logo"; import { UsageWindowRows, usageStatus } from "@/components/usage/usage-window-rows"; import { useAgentSubscriptionUsage } from "@/hooks/domains/settings/use-agent-subscription-usage"; import type { AgentSubscriptionUsage } from "@/lib/types/http"; function AgentUsageCard({ item }: { item: AgentSubscriptionUsage }) { const usage = item.usage; const status = usage && usage.windows.length > 0 ? usageStatus(usage) : null; return (

{item.display_name}

{usage?.plan && ( {usage.plan} )} {status && ( {status.label} )}
{item.error ? (

Could not fetch usage data.

) : ( usage && )}
); } /** * "Subscription Usage" section on Settings > Agents. Shows rate-limit window * utilization for host agents authenticated with a subscription (OAuth) — * Claude Code and Codex. Hidden when no subscription-billed agent is present. */ export function AgentUsageSection() { const { items, loading, refresh } = useAgentSubscriptionUsage(); if (items.length === 0) return null; return (

Subscription Usage

Rate-limit utilization for agents signed in with a subscription plan.

{items.map((item) => ( ))}
); }