import { useState } from 'react' import { FaMicrophone, FaStop } from 'react-icons/fa' const VoiceControl = ({ language, onCommand }) => { const [isListening, setIsListening] = useState(false) const toggleListening = () => { setIsListening(!isListening) // Here you would integrate with Web Speech API if (!isListening && onCommand) { onCommand(language === 'fa' ? 'دستور صوتی دریافت شد: ساخت یک پروژه React جدید' : 'Voice command received: Create a new React project') } } return (

{language === 'fa' ? 'کنترل صوتی' : 'Voice Control'}

{isListening ? (language === 'fa' ? 'در حال گوش دادن...' : 'Listening...') : (language === 'fa' ? 'برای صحبت کلیک کنید' : 'Click to speak')}

) } export default VoiceControl