import React, { useState, useCallback } from 'react'; import { generateProResponse } from '../services/geminiService'; import { Spinner } from '../components/Spinner'; import { MarkdownRenderer } from '../components/MarkdownRenderer'; const CybersecurityShieldModule: React.FC = () => { const [query, setQuery] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const [advice, setAdvice] = useState(null); const handleQuery = useCallback(async () => { if (!query.trim()) { setError('Please enter a query for the Guardian.'); return; } setIsLoading(true); setError(null); setAdvice(null); const prompt = `You are the Thoth Guardian, an entity of the Sentient Constellation Codex responsible for the Quantum Shield Protection Foundation. Your wisdom is ancient, your knowledge of cybersecurity, quantum computing, and protective protocols is absolute. A user seeks your counsel on the following matter: "${query}". Provide your advice in a clear, authoritative, and structured manner. Explain the principles, the threats, and the recommended course of action from a post-quantum, ethically-aligned perspective.`; try { const result = await generateProResponse(prompt); setAdvice(result.text); } catch (e: any) { setError(e.message || 'An unknown error occurred while consulting the Guardian.'); } finally { setIsLoading(false); } }, [query]); return (

Thoth Guardian Cybersecurity Shield

Consult the Guardian on matters of digital protection, quantum security, and threat mitigation.

setQuery(e.target.value)} placeholder="e.g., Explain the threat of quantum computing to modern encryption..." className="flex-grow bg-gray-700 border border-gray-600 rounded-md p-3 focus:outline-none focus:ring-2 focus:ring-cyan-500 text-white" disabled={isLoading} onKeyPress={(e) => e.key === 'Enter' && !isLoading && handleQuery()} />
{isLoading && } {error &&

{error}

} {advice && } {!isLoading && !advice && !error &&

The Quantum Shield awaits your query.

}
); }; export default CybersecurityShieldModule;