|
8 | 8 |
|
9 | 9 | import { useAuth } from '@/contexts/AuthContext' |
10 | 10 | import { useUserUsage } from '@/hooks/useCachedQuery' |
11 | | -import { BarChart3, Package, FunctionSquare, Files, Zap, Search, Server, Sparkles, Lock } from 'lucide-react' |
| 11 | +import { BarChart3, Package, FunctionSquare, Files, Zap, Search, Server, Sparkles, Lock, ArrowRight, TrendingUp } from 'lucide-react' |
12 | 12 | import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' |
| 13 | +import { Button } from '@/components/ui/button' |
13 | 14 | import { Badge } from '@/components/ui/badge' |
14 | 15 | import { Separator } from '@/components/ui/separator' |
15 | 16 | import { Skeleton } from '@/components/ui/Skeleton' |
@@ -95,28 +96,61 @@ export function UsagePage() { |
95 | 96 | </div> |
96 | 97 | </CardContent> |
97 | 98 | </Card> |
| 99 | + |
| 100 | + <Card className="border-dashed"> |
| 101 | + <CardContent className="py-8"> |
| 102 | + <div className="flex flex-col items-center text-center gap-3"> |
| 103 | + <div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center"> |
| 104 | + <TrendingUp className="w-5 h-5 text-muted-foreground" /> |
| 105 | + </div> |
| 106 | + <div> |
| 107 | + <p className="text-sm font-medium">API Cost Tracking</p> |
| 108 | + <p className="text-xs text-muted-foreground mt-1 max-w-xs"> |
| 109 | + Token usage, cost breakdown by model (OpenAI, Voyage, Cohere), |
| 110 | + and monthly spend tracking -- coming soon. |
| 111 | + </p> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </CardContent> |
| 115 | + </Card> |
98 | 116 | </div> |
99 | 117 | ) |
100 | 118 | } |
101 | 119 |
|
102 | 120 |
|
103 | 121 | function PlanCard({ tier }: { tier: string }) { |
| 122 | + const isFree = tier === 'free' |
| 123 | + |
104 | 124 | return ( |
105 | | - <Card> |
106 | | - <CardContent className="flex items-center justify-between py-5"> |
107 | | - <div className="flex items-center gap-3"> |
108 | | - <span className="text-sm text-muted-foreground">Current plan</span> |
109 | | - <Badge |
110 | | - variant="outline" |
111 | | - className={cn('capitalize text-sm px-3 py-1', TIER_COLORS[tier])} |
112 | | - > |
113 | | - {tier} |
114 | | - </Badge> |
| 125 | + <Card className={isFree ? 'border-primary/20' : ''}> |
| 126 | + <CardContent className="py-5 space-y-4"> |
| 127 | + <div className="flex items-center justify-between"> |
| 128 | + <div className="flex items-center gap-3"> |
| 129 | + <span className="text-sm text-muted-foreground">Current plan</span> |
| 130 | + <Badge |
| 131 | + variant="outline" |
| 132 | + className={cn('capitalize text-sm px-3 py-1', TIER_COLORS[tier])} |
| 133 | + > |
| 134 | + {tier} |
| 135 | + </Badge> |
| 136 | + </div> |
| 137 | + {!isFree && ( |
| 138 | + <span className="text-xs text-muted-foreground">Active</span> |
| 139 | + )} |
115 | 140 | </div> |
116 | | - {tier === 'free' && ( |
117 | | - <span className="text-xs text-muted-foreground"> |
118 | | - Upgrade coming soon |
119 | | - </span> |
| 141 | + {isFree && ( |
| 142 | + <div className="flex items-center justify-between rounded-lg bg-primary/5 border border-primary/10 px-4 py-3"> |
| 143 | + <div> |
| 144 | + <p className="text-sm font-medium">Unlock higher limits and priority indexing</p> |
| 145 | + <p className="text-xs text-muted-foreground mt-0.5"> |
| 146 | + Pro: 20 repos, 20K functions/repo, Cohere reranking |
| 147 | + </p> |
| 148 | + </div> |
| 149 | + <Button size="sm" className="ml-4 shrink-0"> |
| 150 | + Upgrade to Pro |
| 151 | + <ArrowRight className="w-3.5 h-3.5 ml-1" /> |
| 152 | + </Button> |
| 153 | + </div> |
120 | 154 | )} |
121 | 155 | </CardContent> |
122 | 156 | </Card> |
|
0 commit comments