import React from 'react'; import { motion } from 'framer-motion'; import { X, Zap } from 'lucide-react'; import { cn } from '@/lib/utils'; import { isLocalMode } from '@/lib/config'; import { Button } from '@/components/ui/button'; export interface UsagePreviewProps { type: 'tokens' | 'upgrade'; subscriptionData?: any; onClose?: () => void; onOpenUpgrade?: () => void; hasMultiple?: boolean; showIndicators?: boolean; currentIndex?: number; totalCount?: number; onIndicatorClick?: (index: number) => void; } export const UsagePreview: React.FC = ({ type, subscriptionData, onClose, onOpenUpgrade, hasMultiple = false, showIndicators = false, currentIndex = 0, totalCount = 1, onIndicatorClick, }) => { if (isLocalMode()) return null; const formatCurrency = (amount: number) => { return `$${amount.toFixed(2)}`; }; const getUsageDisplay = () => { if (!subscriptionData) return 'Loading usage...'; const current = subscriptionData.current_usage || 0; const limit = subscriptionData.cost_limit || 0; if (limit === 0) return 'No usage limit set'; const isOverLimit = current > limit; const usageText = `${formatCurrency(current)} / ${formatCurrency(limit)}`; if (isOverLimit) { return `${usageText} (over limit)`; } return usageText; }; const isOverLimit = () => { if (!subscriptionData) return false; const current = subscriptionData.current_usage || 0; const limit = subscriptionData.cost_limit || 0; return current > limit; }; return (
{/* Icon */}
{/* Content */}

Upgrade for more usage & better AI Models

{getUsageDisplay()}
{/* Apple-style notification indicators - only for multiple notification types */} {showIndicators && totalCount === 2 && ( )}
); };