// ============================================================ // MOORE AI v13 — AI STRATEGY TAB (Jake Moore AI) // Requires: shared/utils.js, shared/components.jsx loaded first // ============================================================ const AICommandView = ({ messages, isTyping, chatInput, setChatInput, handleSendMessage, toggleListening, isListening, chatEndRef, jakeAvatar, crmData, isVoiceEnabled, toggleMute, liveTranscript, activeCalls, approveActions, cancelActions }) => { const { useState } = React; const [showHistory, setShowHistory] = useState(false); return (
{/* Header */}
Neural Architect

Jake Moore AI — Strategy

{crmData.stats.totalLeads} leads · {fmt$(crmData.stats.pipelineValue)} pipeline
{activeCalls && activeCalls.length > 0 && (
CALL ACTIVE · {activeCalls[0].contactName}
)}
{/* Chat area */}
{messages.map((m, i) => { if (m.type === 'action-approval') { return (
); } return (
{m.role === 'ai' && (
)}
{m.role === 'ai' && window.marked && !m.type ?
: m.text }
{m.role === 'user' && }
); })} {isTyping && (
{[0, 200, 400].map(d => (
))}
)}
{/* Suggestions */}
{[ { text: "Summarize my pipeline", icon: "bar-chart-2" }, { text: "Who's closest to closing?", icon: "target" }, { text: "Call my top lead", icon: "phone" }, { text: "Who needs follow-up?", icon: "clock" }, { text: "Show won deals", icon: "trophy" }, { text: "Create action items for this week", icon: "check-square" }, ].map(({text, icon}, i) => ( ))}
{/* Input */}
{isListening && liveTranscript && (
🎤 {liveTranscript}
)}
setChatInput(e.target.value)} placeholder={isListening ? '🎤 Listening... (auto-sends after 2s silence)' : 'Command Jake (e.g. "Mark Bathtub Made New as won")'} className="flex-1 bg-slate-900/60 border border-slate-700/60 rounded-xl px-5 py-3 text-sm text-white outline-none focus:border-blue-500/50 placeholder:text-slate-600 transition-colors" />
{isListening ? 'Speak now — auto-sends after 2s silence' : 'Click mic to use voice · Chrome/Edge only'}
{/* Conversation History Modal */} {showHistory && (
setShowHistory(false)}>
e.stopPropagation()}>
Conversation History
{messages.slice(-20).map((m, i) => (
{m.text}
))}
)}
); };