fix: Market Intel UI - Add missing report fields & Fix back button

- StepReport.tsx: Added Search Strategy ICP, Digital Signals, and Target Pages to both the UI view and the Markdown export.

- StepReport.tsx: Fixed 'Back' button behavior to prevent state reset (uses new onBack prop).

- App.tsx: Passed handleBack to StepReport onBack prop.

- types.ts: Extended SearchStrategy interface with optional fields for the new signals.
This commit is contained in:
2025-12-29 12:40:47 +00:00
parent 199a09f514
commit deed5c6ea4
3 changed files with 18 additions and 3 deletions

View File

@@ -207,7 +207,8 @@ const App: React.FC = () => {
<StepReport
results={analysisResults}
strategy={strategy}
onRestart={handleRestart}
onRestart={handleRestart}
onBack={handleBack}
language={language}
onStartOutreach={(company) => {
setSelectedCompanyForOutreach(company);

View File

@@ -7,11 +7,12 @@ interface StepReportProps {
results: AnalysisResult[];
strategy: SearchStrategy;
onRestart: () => void;
onBack: () => void;
onStartOutreach: (company: AnalysisResult) => void;
language: Language;
}
export const StepReport: React.FC<StepReportProps> = ({ results, strategy, onRestart, onStartOutreach, language }) => {
export const StepReport: React.FC<StepReportProps> = ({ results, strategy, onRestart, onBack, onStartOutreach, language }) => {
const sortedResults = useMemo(() => {
return [...results].sort((a, b) => {
@@ -72,6 +73,10 @@ export const StepReport: React.FC<StepReportProps> = ({ results, strategy, onRes
# Market Intelligence Report: ${strategy.productContext}
**Context:** ${strategy.idealCustomerProfile}
**Search Strategy ICP:** ${strategy.searchStrategyICP || 'N/A'}
**Digital Signals:** ${strategy.digitalSignals || 'N/A'}
**Target Pages:** ${strategy.targetPages || 'N/A'}
| ${headers.join(" | ")} |
|${headers.map(() => "---").join("|")}|
${rows.join("\n")}
@@ -92,6 +97,12 @@ ${rows.join("\n")}
<div>
<h2 className="text-3xl font-bold text-slate-900">Analysis Report</h2>
<p className="text-slate-500">Context: <span className="font-semibold text-indigo-600">{strategy.productContext}</span></p>
<div className="mt-2 text-xs text-slate-500 max-w-4xl">
<p><strong>Ideal Customer Profile:</strong> {strategy.idealCustomerProfile}</p>
<p><strong>Search Strategy ICP:</strong> {strategy.searchStrategyICP}</p>
<p><strong>Digital Signals:</strong> {strategy.digitalSignals}</p>
<p><strong>Target Pages:</strong> {strategy.targetPages}</p>
</div>
</div>
<div className="flex items-center gap-2">
<button onClick={downloadMarkdown} className="bg-white border border-slate-300 hover:bg-slate-50 text-slate-700 font-medium py-2 px-4 rounded-lg flex items-center gap-2 text-sm shadow-sm">
@@ -209,7 +220,7 @@ ${rows.join("\n")}
</div>
<div className="flex-none flex justify-between items-center pt-6 bg-slate-50 border-t border-slate-200 mt-auto sticky bottom-0 z-20">
<button onClick={onRestart} className="text-slate-600 hover:text-indigo-600 font-medium flex items-center gap-2 px-4 py-2">
<button onClick={onBack} className="text-slate-600 hover:text-indigo-600 font-medium flex items-center gap-2 px-4 py-2">
<ArrowLeft size={20} /> Back
</button>
<button onClick={onRestart} className="bg-slate-900 hover:bg-slate-800 text-white font-bold py-3 px-6 rounded-xl shadow-lg transition-all flex items-center gap-2">

View File

@@ -41,6 +41,9 @@ export interface SearchSignal {
export interface SearchStrategy {
productContext: string; // What are we selling?
idealCustomerProfile: string;
searchStrategyICP?: string;
digitalSignals?: string;
targetPages?: string;
signals: SearchSignal[];
}