"use client" import { Coffee, X } from "lucide-react" import Link from "next/link" import type React from "react" import { FaGithub } from "react-icons/fa" import { useDictionary } from "@/hooks/use-dictionary" import { formatMessage } from "@/lib/i18n/utils" interface QuotaLimitToastProps { type?: "request" | "token" used: number limit: number onDismiss: () => void } export function QuotaLimitToast({ type = "request", used, limit, onDismiss, }: QuotaLimitToastProps) { const dict = useDictionary() const isTokenLimit = type === "token" const formatNumber = (n: number) => n >= 1000 ? `${(n / 1000).toFixed(1)}k` : n.toString() const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Escape") { e.preventDefault() onDismiss() } } return (
{isTokenLimit ? dict.quota.messageToken : dict.quota.messageApi}
{dict.quota.reset}