diff --git a/components/layout/top-bar.tsx b/components/layout/top-bar.tsx index 92d6839..b79a0fe 100644 --- a/components/layout/top-bar.tsx +++ b/components/layout/top-bar.tsx @@ -112,8 +112,12 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe // 处理自定义金额购买 const handleCustomAmountBuy = async () => { const amount = parseInt(customAmount); - if (isNaN(amount) || amount <= 0) { - console.error("请输入有效的Token数量"); + if (isNaN(amount) || amount < 50) { + showInsufficientPointsNotification({ + current_balance: credits, + required_tokens: 50, + message: "Minimum purchase is 50 credits.", + }); return; } await handleBuyTokens(amount); @@ -454,7 +458,7 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe onChange={(e) => setCustomAmount(e.target.value)} placeholder="Custom amount" className="flex-1 px-2 py-1 text-xs bg-white/10 text-white placeholder-white/60 border border-white/20 rounded focus:outline-none focus:border-blue-400" - min="1" + min="50" disabled={isBuyingTokens} />