diff --git a/src/components/OnboardingDialog.tsx b/src/components/OnboardingDialog.tsx index 1ab8e51e..3a17b9f2 100644 --- a/src/components/OnboardingDialog.tsx +++ b/src/components/OnboardingDialog.tsx @@ -6,7 +6,6 @@ import { Bot, Check, Sparkles, ArrowRight, ArrowLeft, ExternalLink } from 'lucid import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; import { Checkbox } from '@/components/ui/checkbox'; import { PasswordInput } from '@/components/ui/password-input'; @@ -139,12 +138,12 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) onOpenChange(false); }; - const formatPrice = (price: Decimal | undefined) => { - if (!price) return 'unknown'; - if (price.equals(0)) return 'Free'; - // Convert from per-token to per-1M tokens and format with $ prefix - const pricePerMillion = price.times(1_000_000); - return '$' + pricePerMillion.toFixed(2).toString().replace(/\.00$/, '') + '/M tokens'; + const formatPrice = (pricing: { prompt: Decimal; completion: Decimal }) => { + if (!pricing) return 'unknown'; + if (pricing.prompt.equals(0) && pricing.completion.equals(0)) return 'Free'; + const prompt = pricing.prompt.times(1_000_000).toFixed(2).toString().replace(/\.00$/, ''); + const completion = pricing.completion.times(1_000_000).toFixed(2).toString().replace(/\.00$/, ''); + return `$${prompt}/M↑ $${completion}/M↓`; }; // Reset state when dialog opens/closes @@ -512,14 +511,12 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) ) : ( providerModels.map((model) => { const isSelected = selectedModel === model.fullId; - const isFree = model.pricing?.prompt.equals(0) && model.pricing?.completion.equals(0); - const isPremium = !!model.pricing && !isFree; const modelName = model.name || model.id; return ( handleModelSelect(model.fullId)} @@ -527,46 +524,29 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
- + {modelName} {model.description && ( -

- {model.description.length > 70 - ? model.description.slice(0, 70) + '...' +

+ {model.description.length > 500 + ? model.description.slice(0, 500) + '...' : model.description}

)}
-
- {isFree && ( - - Free - - )} - {isPremium && ( - - Premium - - )} - {isSelected && ( -
- -
- )} -
+ {isSelected && ( +
+ +
+ )}
{(model.pricing || model.contextLength) && (
{model.pricing && ( -
-
Input: {formatPrice(model.pricing.prompt)}
-
Output: {formatPrice(model.pricing.completion)}
-
+ {formatPrice(model.pricing)} )} {model.contextLength && ( Context: {model.contextLength.toLocaleString()} tokens