import React, { useState } from 'react'; const AdvancedSettings = ({ similarityTemperature, onTemperatureChange, difficultyWeight, onWeightChange }) => { const [isExpanded, setIsExpanded] = useState(false); const presets = [ { name: 'Default', temp: 0.2, weight: 0.5, description: 'Balanced settings (recommended)' }, { name: 'Focused', temp: 0.1, weight: 0.3, description: 'Deterministic, similarity-based' }, { name: 'Varied', temp: 0.7, weight: 0.5, description: 'More randomness and variety' }, { name: 'Challenging', temp: 0.5, weight: 0.7, description: 'Respects difficulty levels more' } ]; const applyPreset = (preset) => { onTemperatureChange(preset.temp); onWeightChange(preset.weight); }; const getTemperatureDescription = (value) => { if (value <= 0.3) return 'Deterministic (top similar words)'; if (value <= 0.6) return 'Balanced (good variety)'; if (value <= 1.0) return 'Random (surprising choices)'; return 'Very random (unpredictable)'; }; const getWeightDescription = (value) => { if (value <= 0.2) return 'Similarity-focused'; if (value <= 0.4) return 'Slightly similarity-focused'; if (value <= 0.6) return 'Balanced'; if (value <= 0.8) return 'Slightly frequency-focused'; return 'Frequency-focused'; }; return (
setIsExpanded(!isExpanded)} > ⚙️ Advanced Settings {isExpanded ? '▼' : '▶'}
{isExpanded && (
onTemperatureChange(parseFloat(e.target.value))} className="slider" />
More focused More variety
{getTemperatureDescription(similarityTemperature)}
onWeightChange(parseFloat(e.target.value))} className="slider" />
Similarity Frequency
{getWeightDescription(difficultyWeight)}
Quick Presets:
{presets.map((preset, index) => ( ))}
Temperature: Controls how random word selection is. Lower values pick the most similar words, higher values add variety.
Weight: Balances similarity vs word frequency. Lower focuses on semantic similarity, higher respects difficulty levels.
)}
); }; export default AdvancedSettings;