import React, { useState } from 'react'; import { analyzeScenario } from '../api/client'; import { Printer, Download, Sparkles, Map, Target, Server, CheckCircle2, MapPin, Send } from 'lucide-react'; export function StrategyGeneratorTab() { const [scenario, setScenario] = useState(''); const [loading, setLoading] = useState(false); const [strategy, setStrategy] = useState(''); const [error, setError] = useState(null); const QUICK_SCENARIOS = [ "Multi-zone earthquake with cascading road failures", "Category 5 hurricane triggering false SOS anomalies", "Urban flooding demanding priority airlift routing", "Widespread wildfires with supply chain disruptions" ]; const handleGenerate = async () => { if (!scenario.trim()) return; setLoading(true); setStrategy(''); setError(null); try { const response = await analyzeScenario(scenario); setStrategy(response.strategy); } catch(err: any) { setError(err.message || String(err)); } finally { setLoading(false); } }; const renderMarkdown = (text: string) => { return text.split('\n').map((line, i) => { if (line.startsWith('# ')) return

{line.slice(2)}

; if (line.startsWith('## ')) return

{line.slice(3)}

; if (line.startsWith('### ')) return

{line.slice(4)}

; let htmlMode = line; htmlMode = htmlMode.replace(/\*\*(.*?)\*\*/g, '$1'); htmlMode = htmlMode.replace(/\*(.*?)\*/g, '$1'); if (line.startsWith('- ')) return
  • ; if (line.trim() === '') return
    ; return

    ; }); }; return (
    {/* Left Column: Input and Output */}
    {/* Input Area */}

    Scenario Analyzer

    Describe a situation to generate resource allocation strategy

    {QUICK_SCENARIOS.map(s => ( ))}
    {/* Output Area */}

    Generated Strategy

    {loading && (
    Running Neural Simulation...
    )} {error &&
    Error: {error}
    } {!loading && !error && strategy && (
    {renderMarkdown(strategy)}
    )} {!loading && !error && !strategy && (
    Awaiting scenario input...
    )}
    {/* Right Column: Info Cards - Hide on print */}

    System Capabilities

    106
    Verified Test Scenarios
    1ms
    Triage Latency
    4-Stage
    Agent Pipeline
    10K+
    Evaluated Environments

    How It Works

    1

    Describe a scenario or select from quick options

    2

    DisasterMan AI agents analyze and simulate outcomes

    3

    Receive comprehensive resource allocation strategy

    4

    Export or print for implementation

    Example Queries

    • "Urban flood affecting Zones A, B, C with high casualty risk"
    • "False SOS signals flooding HQ communication channels"
    • "Multi-vector cyclone destroying primary land routes"
    • "Chemical spill trapped victims requiring immediate airlift extraction"
    ); }