'use client'; import React from 'react'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { CheckCircle2, AlertCircle, XCircle, Zap, RotateCcw, Info, AlertTriangle } from 'lucide-react'; import { cn } from '@/lib/utils'; interface ModelSelectionIndicatorProps { modelName: string | null; isAutoSelected: boolean; isUserOverride: boolean; isLoaded?: boolean; onClearOverride?: () => void; onRevertToAuto?: () => void; className?: string; } export function ModelSelectionIndicator({ modelName, isAutoSelected, isUserOverride, isLoaded = false, onClearOverride, onRevertToAuto, className }: ModelSelectionIndicatorProps) { if (!modelName) { return (
No model selected
); } const getIndicatorColor = () => { if (isUserOverride) { return 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200'; } if (isAutoSelected) { return 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'; } return 'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200'; }; const getIndicatorIcon = () => { if (isUserOverride) { return ; } if (isAutoSelected) { return ; } return ; }; const getIndicatorText = () => { if (isUserOverride) { return 'Manual'; } if (isAutoSelected) { return 'Auto'; } return 'Selected'; }; return (
{getIndicatorIcon()} {getIndicatorText()} {modelName} {isUserOverride && onClearOverride && ( )} {isUserOverride && onRevertToAuto && ( )}
); } interface ModelSelectionWarningProps { warnings: string[]; errors: string[]; onClearWarnings?: () => void; className?: string; } export function ModelSelectionWarning({ warnings, errors, onClearWarnings, className }: ModelSelectionWarningProps) { if (warnings.length === 0 && errors.length === 0) { return null; } return (
{errors.map((error, index) => (

{error}

))} {warnings.map((warning, index) => (

{warning}

))} {onClearWarnings && warnings.length > 0 && ( )}
); } interface AutoSelectionStatusProps { isAutoSelecting: boolean; hasAutoSelection: boolean; onRetryAutoSelection?: () => void; className?: string; } export function AutoSelectionStatus({ isAutoSelecting, hasAutoSelection, onRetryAutoSelection, className }: AutoSelectionStatusProps) { if (isAutoSelecting) { return (
Auto-selecting models...
); } if (!hasAutoSelection) { return (
No automatic selection available {onRetryAutoSelection && ( )}
); } return (
Models auto-selected
); }