import { motion } from 'framer-motion' import { Brain, Gauge, Layers, Aperture } from 'lucide-react' import type { ComponentType } from 'react' import type { ModelMode } from '../types' interface Props { selectedMode: ModelMode availableModes: Set onSelectMode: (mode: ModelMode) => void onContinue: () => void } type ModeMeta = { key: ModelMode title: string subtitle: string details: string icon: ComponentType<{ size?: number }> } const MODE_OPTIONS: ModeMeta[] = [ { key: 'ensemble', title: 'Ensemble (Recommended)', subtitle: 'Balanced accuracy and reliability', details: 'Starts with A, falls back to B and C when confidence is low.', icon: Layers, }, { key: 'A', title: 'Pipeline A', subtitle: 'Fastest response', details: 'XGBoost using hand landmarks only.', icon: Gauge, }, { key: 'B', title: 'Pipeline B', subtitle: 'Stronger landmark reasoning', details: 'Autoencoder embeddings with LightGBM.', icon: Brain, }, { key: 'C', title: 'Pipeline C', subtitle: 'Image-based fallback model', details: 'CNN features with SVM using webcam snapshots.', icon: Aperture, }, ] export function ModelSelector({ selectedMode, availableModes, onSelectMode, onContinue, }: Props) { const canContinue = selectedMode === 'ensemble' || availableModes.has(selectedMode) return (

Choose Recognition Model

Select how predictions should be generated for this session.

{MODE_OPTIONS.map((option) => { const Icon = option.icon const selected = selectedMode === option.key const available = option.key === 'ensemble' || availableModes.has(option.key) return ( ) })}

Tip: Ensemble is best for most users. Use A for low-latency demos.

) }