"use client"; import { OctagonAlert, Orbit, X } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; import { cn } from "@/lib/utils"; interface QuotaWarningBannerProps { used: number; limit: number; warningThreshold: number; className?: string; } export function QuotaWarningBanner({ used, limit, warningThreshold, className, }: QuotaWarningBannerProps) { const [dismissed, setDismissed] = useState(false); const isWarning = used >= warningThreshold && used < limit; const isExceeded = used >= limit; if (dismissed || (!isWarning && !isExceeded)) return null; if (isExceeded) { return (
Free token limit reached
You've used all {limit.toLocaleString()} free tokens. Create a free account to get 5 million tokens and access to all models.
You've used {used.toLocaleString()} of {limit.toLocaleString()} free tokens.{" "} Create an account {" "} for 5M free tokens.