diff --git a/general-market-intelligence/components/StepStrategy.tsx b/general-market-intelligence/components/StepStrategy.tsx new file mode 100644 index 00000000..b34a1470 --- /dev/null +++ b/general-market-intelligence/components/StepStrategy.tsx @@ -0,0 +1,127 @@ + +import React, { useState } from 'react'; +import { SearchStrategy, SearchSignal } from '../types'; +import { Settings, Edit2, CheckCircle2, Plus, Trash2, HelpCircle } from 'lucide-react'; + +interface StepStrategyProps { + strategy: SearchStrategy; + onConfirm: (strategy: SearchStrategy) => void; +} + +export const StepStrategy: React.FC = ({ strategy, onConfirm }) => { + const [localStrategy, setLocalStrategy] = useState(strategy); + + const handleSignalChange = (index: number, field: keyof SearchSignal, value: any) => { + const newSignals = [...localStrategy.signals]; + newSignals[index] = { ...newSignals[index], [field]: value }; + setLocalStrategy({ ...localStrategy, signals: newSignals }); + }; + + const handleRemoveSignal = (index: number) => { + setLocalStrategy({ + ...localStrategy, + signals: localStrategy.signals.filter((_, i) => i !== index) + }); + }; + + const handleAddSignal = () => { + const newId = `sig_${Date.now()}`; + setLocalStrategy({ + ...localStrategy, + signals: [...localStrategy.signals, { + id: newId, + name: "New Signal", + description: "Describe what to look for...", + targetPageKeywords: ["homepage"] + }] + }); + }; + + return ( +
+
+

Define Search Strategy

+

Based on {strategy.productContext}, we identified these digital traces to look for.

+
+ +
+

Ideal Customer Profile (AI Generated)

+

+ "{localStrategy.idealCustomerProfile}" +

+
+ +
+
+

+ + Digital Signals (The "Audit") +

+ +
+ + {localStrategy.signals.map((signal, index) => ( +
+
+
+ {index + 1} +
+
+
+
+ + handleSignalChange(index, 'name', e.target.value)} + className="w-full font-bold text-slate-900 border-b border-slate-200 focus:border-indigo-500 outline-none py-1" + /> +
+
+ + handleSignalChange(index, 'targetPageKeywords', e.target.value.split(',').map(s => s.trim()))} + className="w-full text-slate-600 border-b border-slate-200 focus:border-indigo-500 outline-none py-1 text-sm" + placeholder="e.g. about, legal, careers" + /> +
+
+
+ +