sanity-plugin-seo-copilot 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +63 -50
  2. package/dist/index.js +841 -782
  3. package/dist/index.mjs +763 -704
  4. package/package.json +62 -64
  5. package/dist/index.js.map +0 -1
  6. package/dist/index.mjs.map +0 -1
  7. package/sanity.json +0 -3
  8. package/src/components/ChatPanel.tsx +0 -311
  9. package/src/components/ConfigContext.tsx +0 -22
  10. package/src/components/FeedbackButton.tsx +0 -218
  11. package/src/components/KeywordBadge.tsx +0 -50
  12. package/src/components/KeywordPanel.tsx +0 -1234
  13. package/src/components/OnboardingPopup.tsx +0 -108
  14. package/src/components/PlacementIndicators.tsx +0 -80
  15. package/src/components/ReportProblemButton.tsx +0 -212
  16. package/src/components/SEOCopilotPanel.tsx +0 -1287
  17. package/src/components/ScoreDonut.tsx +0 -158
  18. package/src/components/SeedKeywordInput.tsx +0 -128
  19. package/src/components/ShimmerLoader.tsx +0 -123
  20. package/src/components/TabBar.tsx +0 -373
  21. package/src/components/styles.ts +0 -158
  22. package/src/components/tabs/AEOTab.tsx +0 -585
  23. package/src/components/tabs/LinkingTab.tsx +0 -446
  24. package/src/components/tabs/MetaTab.tsx +0 -431
  25. package/src/components/tabs/SummaryTab.tsx +0 -405
  26. package/src/components/tabs/TechnicalTab.tsx +0 -933
  27. package/src/hooks/useDocumentContent.ts +0 -48
  28. package/src/hooks/useKeywordAnalysis.ts +0 -292
  29. package/src/hooks/useSEOChat.ts +0 -254
  30. package/src/index.ts +0 -18
  31. package/src/inspector.ts +0 -58
  32. package/src/lib/api.ts +0 -262
  33. package/src/lib/apiKey.ts +0 -30
  34. package/src/lib/documentExtract.ts +0 -422
  35. package/src/lib/geoAnalysis.ts +0 -122
  36. package/src/lib/persistence.ts +0 -69
  37. package/src/lib/scoring.ts +0 -197
  38. package/src/lib/summary.ts +0 -645
  39. package/src/lib/types.ts +0 -212
  40. package/src/lib/utils.ts +0 -35
  41. package/v2-incompatible.js +0 -10
@@ -1,585 +0,0 @@
1
- import { useEffect, useMemo, useRef, useState } from "react";
2
- import { LoadingBars } from "../SEOCopilotPanel";
3
- import { FeedbackButton } from "../FeedbackButton";
4
- import { analyzeGEO } from "../../lib/geoAnalysis";
5
- import { usePersistentState } from "../../lib/persistence";
6
- import type { DeepAnalysis, ContentSuggestions } from "../../lib/types";
7
-
8
- const AEO_PURPLE = "#005DAC";
9
- const GEO_TEAL = "#C9A716";
10
-
11
- interface AEOTabProps {
12
- text: string;
13
- deepAnalysis: DeepAnalysis | null;
14
- isDeepLoading: boolean;
15
- publication?: string;
16
- runDeepAnalysis: () => void;
17
- aeoContentChanged: boolean;
18
- headings?: string[];
19
- contentSuggestions: ContentSuggestions | null;
20
- isCSLoading: boolean;
21
- csError: string | null;
22
- loadContentSuggestions: () => void;
23
- }
24
-
25
- const cardStyle: React.CSSProperties = {
26
- borderRadius: 14,
27
- background: "rgba(255,255,255,0.55)",
28
- backdropFilter: "blur(16px) saturate(170%)",
29
- WebkitBackdropFilter: "blur(16px) saturate(170%)",
30
- boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.85), inset 1.5px 2px 1px -1px rgba(255,255,255,1), inset -2px -3px 2px -1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.07), 0 10px 26px rgba(0,0,0,0.08)",
31
- padding: "14px",
32
- };
33
-
34
- // Small "AI" pill - inline label marking generative content at the point of generation.
35
- function AiPill() {
36
- return (
37
- <span
38
- style={{
39
- fontSize: 8.5,
40
- fontWeight: 700,
41
- letterSpacing: "0.06em",
42
- padding: "1px 5px",
43
- borderRadius: 99,
44
- background: "rgba(0,0,0,0.06)",
45
- color: "#4b5563",
46
- flexShrink: 0,
47
- }}
48
- title="Generated by AI - verify before publishing"
49
- >
50
- AI
51
- </span>
52
- );
53
- }
54
-
55
- function SectionHeader({ label, iconColor, ai }: { label: string; iconColor: string; ai?: boolean }) {
56
- return (
57
- <div style={{ display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }}>
58
- <div style={{ width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 }} />
59
- <span style={{ fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }}>
60
- {label}
61
- </span>
62
- {ai && <AiPill />}
63
- </div>
64
- );
65
- }
66
-
67
- function CopyButton({ text }: { text: string }) {
68
- const [copied, setCopied] = useState(false);
69
- const copyTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
70
- useEffect(() => { return () => { if (copyTimerRef.current) clearTimeout(copyTimerRef.current); }; }, []);
71
- const handleCopy = async () => {
72
- try {
73
- await navigator.clipboard.writeText(text);
74
- setCopied(true);
75
- copyTimerRef.current = setTimeout(() => setCopied(false), 1500);
76
- } catch {
77
- // silent
78
- }
79
- };
80
- return (
81
- <button
82
- onClick={handleCopy}
83
- style={{
84
- background: "none",
85
- border: "none",
86
- cursor: "pointer",
87
- padding: 2,
88
- display: "flex",
89
- alignItems: "center",
90
- gap: 3,
91
- color: copied ? "#16a34a" : "#9ca3af",
92
- fontSize: 10,
93
- fontWeight: 600,
94
- flexShrink: 0,
95
- transition: "color 150ms",
96
- }}
97
- title={copied ? "Copied!" : "Copy to clipboard"}
98
- >
99
- {copied ? (
100
- <svg width="11" height="11" viewBox="0 0 20 20" fill="currentColor">
101
- <path fillRule="evenodd" d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z" clipRule="evenodd" />
102
- </svg>
103
- ) : (
104
- <svg width="11" height="11" viewBox="0 0 20 20" fill="currentColor">
105
- <path d="M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" />
106
- <path d="M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" />
107
- </svg>
108
- )}
109
- </button>
110
- );
111
- }
112
-
113
- function GEOCard({ geo, publication }: { geo: ReturnType<typeof analyzeGEO>; publication?: string }) {
114
- const [showDetails, setShowDetails] = usePersistentState<boolean>("seo-copilot-ui-geo-details", false);
115
- const fd = geo.factDensity;
116
- // Short-form content (news briefs, previews) naturally has low fact density,
117
- // so don't show an alarming red "Weak" - present it neutrally instead.
118
- const isShort = fd.totalWords > 0 && fd.totalWords < 600;
119
- const effectiveStatus = fd.status === "weak" && isShort ? "moderate" : fd.status;
120
- const fdColor = effectiveStatus === "strong" ? "#16a34a" : effectiveStatus === "moderate" ? "#8B7310" : "#dc2626";
121
- const fdLabel = fd.status === "strong" ? "Strong" : fd.status === "moderate" ? "Moderate" : isShort ? "Light (short-form)" : "Weak";
122
- const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
123
-
124
- const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
125
- const totalHeadings = geo.headingAudit.length;
126
-
127
- return (
128
- <div style={cardStyle}>
129
- <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }}>
130
- <SectionHeader label="AI Citation Readiness" iconColor={GEO_TEAL} />
131
- <FeedbackButton suggestionType="geo_summary" suggestionText={`facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`} publication={publication} />
132
- </div>
133
- <div style={{ fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }}>
134
- How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite.
135
- </div>
136
-
137
- {/* Fact density - the single most predictive GEO signal per 2026 research.
138
- The badge shows the RATE (per 1,000 words); the description gives total count
139
- + guidance. Two consistent numbers with explicit units, not one bare integer. */}
140
- <div
141
- style={{
142
- display: "flex",
143
- alignItems: "center",
144
- gap: 12,
145
- padding: "10px 12px",
146
- background: fdBg,
147
- borderRadius: 10,
148
- marginBottom: 8,
149
- }}
150
- >
151
- <div
152
- style={{
153
- width: 56,
154
- height: 56,
155
- borderRadius: "50%",
156
- background: "#ffffff",
157
- display: "flex",
158
- flexDirection: "column",
159
- alignItems: "center",
160
- justifyContent: "center",
161
- flexShrink: 0,
162
- boxShadow: "0 1px 2px rgba(0,0,0,0.06)",
163
- }}
164
- >
165
- <span style={{ fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }}>{fd.factsPerThousandWords}</span>
166
- <span style={{ fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }}>
167
- PER 1K
168
- </span>
169
- </div>
170
- <div style={{ flex: 1, minWidth: 0 }}>
171
- <div style={{ fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }}>Fact density: {fdLabel}</div>
172
- <div style={{ fontSize: 11, color: "#1f2937", lineHeight: 1.45 }}>
173
- {fd.factCount} specific stat{fd.factCount === 1 ? "" : "s"} or citation{fd.factCount === 1 ? "" : "s"} in this article ({fd.factsPerThousandWords} per 1,000 words).{" "}
174
- {fd.status === "strong"
175
- ? "AI engines prefer this density."
176
- : fd.status === "moderate"
177
- ? "Aim for 8+ per 1,000 words with named sources (NEJM, JAMA, FDA, trial numbers, p-values)."
178
- : isShort
179
- ? "Short-form content naturally has fewer stats - fine for news and previews. Add a citation or two where you can."
180
- : "Vague claims get skipped. Add specific numbers, trial citations, or dates."}
181
- </div>
182
- </div>
183
- </div>
184
-
185
- {/* Long passages without concrete stats */}
186
- {fd.driftPassages > 0 && (
187
- <div
188
- style={{
189
- padding: "8px 10px",
190
- background: "rgba(220,38,38,0.04)",
191
- border: "1px solid rgba(220,38,38,0.12)",
192
- borderRadius: 8,
193
- marginBottom: 8,
194
- fontSize: 11,
195
- color: "#7f1d1d",
196
- lineHeight: 1.45,
197
- }}
198
- >
199
- <strong>{fd.driftPassages}</strong> passage{fd.driftPassages === 1 ? "" : "s"} over 200 words with no specific stats or citations. AI engines tend to skip these.
200
- </div>
201
- )}
202
-
203
- {/* Short-answer paragraphs after headings */}
204
- {totalHeadings > 0 && (
205
- <div style={{ marginTop: 4 }}>
206
- <button
207
- onClick={() => setShowDetails((v) => !v)}
208
- style={{
209
- width: "100%",
210
- display: "flex",
211
- alignItems: "center",
212
- justifyContent: "space-between",
213
- padding: "8px 10px",
214
- background: "rgba(201,167,22,0.06)",
215
- border: "1px solid rgba(201,167,22,0.15)",
216
- borderRadius: 8,
217
- cursor: "pointer",
218
- fontSize: 11,
219
- fontWeight: 600,
220
- color: GEO_TEAL,
221
- }}
222
- >
223
- <span>
224
- Short-answer paragraphs: {goodCount}/{totalHeadings} headings have one
225
- </span>
226
- <svg width="11" height="11" viewBox="0 0 20 20" fill="currentColor" style={{ transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }}>
227
- <path fillRule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clipRule="evenodd" />
228
- </svg>
229
- </button>
230
- {showDetails && (
231
- <div style={{ marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }}>
232
- <div style={{ fontSize: 10, color: "#4b5563", marginBottom: 4 }}>
233
- Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract.
234
- </div>
235
- {geo.headingAudit.map((h, i) => {
236
- const c =
237
- h.status === "good"
238
- ? { bg: "rgba(22,163,74,0.08)", color: "#16a34a", label: `${h.words} words ✓` }
239
- : h.status === "too-short"
240
- ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - too short` }
241
- : h.status === "too-long"
242
- ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - condense to 40-60` }
243
- : { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "no body content" };
244
- return (
245
- <div
246
- key={i}
247
- style={{
248
- display: "flex",
249
- alignItems: "center",
250
- justifyContent: "space-between",
251
- padding: "5px 10px",
252
- background: c.bg,
253
- borderRadius: 6,
254
- fontSize: 11,
255
- gap: 8,
256
- }}
257
- >
258
- <span style={{ flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
259
- {h.heading}
260
- </span>
261
- <span style={{ fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }}>{c.label}</span>
262
- </div>
263
- );
264
- })}
265
- </div>
266
- )}
267
- </div>
268
- )}
269
- </div>
270
- );
271
- }
272
-
273
- export function AEOTab({
274
- text,
275
- deepAnalysis,
276
- isDeepLoading,
277
- publication,
278
- runDeepAnalysis,
279
- aeoContentChanged,
280
- headings = [],
281
- contentSuggestions,
282
- isCSLoading,
283
- csError,
284
- loadContentSuggestions,
285
- }: AEOTabProps) {
286
- const geo = useMemo(() => analyzeGEO(text, headings), [text, headings]);
287
- // GEO needs ~150+ words to produce meaningful density readings - below that, factsPer1k
288
- // is dominated by sample noise. Allow AEO sections to render with less text though.
289
- const geoWordCount = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
290
- const hasEnoughTextForGEO = geoWordCount >= 150;
291
- const hasEnoughText = text && text.trim().length >= 50;
292
-
293
- const aeo = deepAnalysis?.aeo;
294
- const questionHeadings =
295
- aeo?.questionHeadings?.map((qh) => ({
296
- heading: qh.suggestedHeading,
297
- originalHeading: qh.originalHeading,
298
- rationale: qh.rationale,
299
- })) ??
300
- aeo?.headingSuggestions?.map((h) => ({
301
- heading: h.heading,
302
- originalHeading: undefined as string | undefined,
303
- rationale: h.rationale,
304
- })) ??
305
- [];
306
-
307
- return (
308
- <div style={{ padding: 12, display: "flex", flexDirection: "column", gap: 12 }}>
309
- {/* The AI-generated disclaimer lives in the panel-level notice now, above
310
- the tab bar - so every tab shows it once, not per-tab. */}
311
-
312
- {/* The "Keep it fresh" / Updated-on notice now lives at the top of the Meta tab. */}
313
-
314
- {/* Content changed banner */}
315
- {aeoContentChanged && (
316
- <div
317
- onClick={runDeepAnalysis}
318
- role="button"
319
- tabIndex={0}
320
- onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); runDeepAnalysis(); } }}
321
- style={{
322
- padding: "8px 12px",
323
- background: "#fffbeb",
324
- border: "1px solid #fde68a",
325
- borderRadius: 8,
326
- display: "flex",
327
- alignItems: "center",
328
- justifyContent: "space-between",
329
- cursor: "pointer",
330
- }}
331
- >
332
- <span style={{ fontSize: 11, color: "#92400e" }}>Content has changed since this was generated.</span>
333
- <span style={{ fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }}>Update</span>
334
- </div>
335
- )}
336
-
337
- {/* GEO (Generative Engine Optimization) - client-side, needs ~150 words to be meaningful */}
338
- {hasEnoughTextForGEO && <GEOCard geo={geo} publication={publication} />}
339
- {hasEnoughText && !hasEnoughTextForGEO && (
340
- <div style={{ ...cardStyle, textAlign: "center" }}>
341
- <div style={{ fontSize: 11, color: "#4b5563", lineHeight: 1.5 }}>
342
- <strong style={{ color: "#C9A716" }}>AI citation analysis</strong> needs at least 150 words to read fact density.
343
- <br />
344
- <span style={{ color: "#4b5563" }}>Current: {geoWordCount} word{geoWordCount === 1 ? "" : "s"}</span>
345
- </div>
346
- </div>
347
- )}
348
-
349
- {/* AEO loading / empty states */}
350
- {!deepAnalysis && isDeepLoading && (
351
- <div style={{ ...cardStyle, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }}>
352
- <LoadingBars size="xs" color={AEO_PURPLE} />
353
- <span style={{ fontSize: 12, color: "#4b5563" }}>Generating AEO insights...</span>
354
- </div>
355
- )}
356
-
357
- {!deepAnalysis && !isDeepLoading && (
358
- <div style={{ ...cardStyle, textAlign: "center" }}>
359
- <div style={{ fontSize: 12, color: "#4b5563" }}>AI citation readiness and question-style heading suggestions appear here once analysis runs.</div>
360
- <button
361
- onClick={runDeepAnalysis}
362
- disabled={!hasEnoughText}
363
- style={{
364
- marginTop: 10,
365
- padding: "6px 14px",
366
- fontSize: 11,
367
- fontWeight: 600,
368
- color: !hasEnoughText ? "#9ca3af" : "#ffffff",
369
- background: !hasEnoughText ? "#e5e7eb" : AEO_PURPLE,
370
- border: "none",
371
- borderRadius: 6,
372
- cursor: !hasEnoughText ? "not-allowed" : "pointer",
373
- }}
374
- >
375
- Run analysis
376
- </button>
377
- </div>
378
- )}
379
-
380
- {deepAnalysis && !aeo && (
381
- <div style={{ ...cardStyle, textAlign: "center" }}>
382
- <span style={{ fontSize: 12, color: "#4b5563" }}>
383
- No insights came back. Try again - the analysis may have timed out.
384
- </span>
385
- </div>
386
- )}
387
-
388
- {/* Question-style headings */}
389
- {questionHeadings.length > 0 && (
390
- <div style={cardStyle}>
391
- <SectionHeader label="Question-Style Headings" iconColor={AEO_PURPLE} />
392
- <div style={{ fontSize: 10, color: "#4b5563", marginBottom: 8 }}>
393
- Rewrites of your existing headings as questions. Google often pulls these into featured snippets.
394
- </div>
395
- <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
396
- {questionHeadings.map((h, i) => (
397
- <div
398
- key={i}
399
- style={{
400
- padding: "8px 10px",
401
- background: "rgba(0,93,172,0.03)",
402
- borderRadius: 10,
403
- borderLeft: `3px solid ${AEO_PURPLE}`,
404
- }}
405
- >
406
- <div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }}>
407
- <div style={{ flex: 1 }}>
408
- {h.originalHeading && (
409
- <div style={{ fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }}>
410
- {h.originalHeading}
411
- </div>
412
- )}
413
- <div style={{ fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }}>{h.heading}</div>
414
- </div>
415
- <div style={{ display: "flex", alignItems: "center", gap: 4 }}>
416
- <CopyButton text={h.heading} />
417
- <FeedbackButton suggestionType="aeo_heading" suggestionText={h.heading} publication={publication} />
418
- </div>
419
- </div>
420
- <div style={{ fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }}>{h.rationale}</div>
421
- </div>
422
- ))}
423
- </div>
424
- </div>
425
- )}
426
-
427
- {/* Generated content blocks - inline summaries / infographics / bullets that travel
428
- alongside the article and increase its chance of getting cited. */}
429
- <div style={cardStyle}>
430
- <SectionHeader label="Content Block Suggestions" iconColor={AEO_PURPLE} />
431
- <div style={{ fontSize: 10, color: "#4b5563", marginBottom: 10 }}>
432
- Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points.
433
- </div>
434
-
435
- {!contentSuggestions && !isCSLoading && (
436
- <button
437
- onClick={loadContentSuggestions}
438
- disabled={!text || text.trim().length < 100}
439
- style={{
440
- width: "100%",
441
- padding: "8px 12px",
442
- fontSize: 11,
443
- fontWeight: 600,
444
- color: !text || text.trim().length < 100 ? "#9ca3af" : "#ffffff",
445
- background: !text || text.trim().length < 100 ? "#e5e7eb" : AEO_PURPLE,
446
- border: "none",
447
- borderRadius: 6,
448
- cursor: !text || text.trim().length < 100 ? "not-allowed" : "pointer",
449
- display: "flex",
450
- alignItems: "center",
451
- justifyContent: "center",
452
- gap: 6,
453
- transition: "all 150ms",
454
- }}
455
- >
456
- Generate suggestions
457
- </button>
458
- )}
459
-
460
- {isCSLoading && (
461
- <div style={{ display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }}>
462
- <LoadingBars size="xs" color={AEO_PURPLE} />
463
- <span style={{ fontSize: 11, color: "#4b5563" }}>Generating content suggestions...</span>
464
- </div>
465
- )}
466
-
467
- {csError && (
468
- <div style={{ marginTop: 6, fontSize: 11, color: "#dc2626" }}>{csError}</div>
469
- )}
470
-
471
- {contentSuggestions && (
472
- <div style={{ display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }}>
473
- {/* Key Takeaways */}
474
- {contentSuggestions.keyTakeaways.length > 0 && (
475
- <div>
476
- <div style={{ fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }}>
477
- Key Takeaways
478
- </div>
479
- <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
480
- {contentSuggestions.keyTakeaways.map((kt, i) => (
481
- <div
482
- key={i}
483
- style={{
484
- padding: "6px 10px",
485
- background: "rgba(0,93,172,0.03)",
486
- borderRadius: 8,
487
- borderLeft: `2px solid ${AEO_PURPLE}`,
488
- display: "flex",
489
- gap: 8,
490
- alignItems: "flex-start",
491
- }}
492
- >
493
- <span style={{ fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }}>{kt}</span>
494
- <div style={{ display: "flex", alignItems: "center", gap: 4 }}>
495
- <CopyButton text={kt} />
496
- <FeedbackButton suggestionType="aeo_takeaway" suggestionText={kt} publication={publication} />
497
- </div>
498
- </div>
499
- ))}
500
- </div>
501
- </div>
502
- )}
503
-
504
- {/* Infographic Opportunities */}
505
- {contentSuggestions.infographicOpportunities.length > 0 && (
506
- <div>
507
- <div style={{ fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }}>
508
- Infographic Ideas
509
- </div>
510
- <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
511
- {contentSuggestions.infographicOpportunities.map((io, i) => (
512
- <div
513
- key={i}
514
- style={{
515
- padding: "8px 10px",
516
- background: "rgba(0,93,172,0.03)",
517
- borderRadius: 8,
518
- borderLeft: `2px solid ${AEO_PURPLE}`,
519
- }}
520
- >
521
- <div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }}>
522
- <span style={{ fontSize: 12, fontWeight: 700, color: AEO_PURPLE }}>{io.concept}</span>
523
- <FeedbackButton suggestionType="aeo_infographic" suggestionText={io.concept} publication={publication} />
524
- </div>
525
- <div style={{ fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }}>{io.description}</div>
526
- </div>
527
- ))}
528
- </div>
529
- </div>
530
- )}
531
-
532
- {/* Bullet List Items */}
533
- {contentSuggestions.bulletListItems.length > 0 && (
534
- <div>
535
- <div style={{ fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }}>
536
- Bullets for Featured Snippets
537
- </div>
538
- <div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }}>
539
- <ul style={{ margin: 0, paddingLeft: 18, flex: 1 }}>
540
- {contentSuggestions.bulletListItems.map((b, i) => (
541
- <li key={i} style={{ fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }}>
542
- {b}
543
- </li>
544
- ))}
545
- </ul>
546
- <div style={{ display: "flex", alignItems: "center", gap: 4 }}>
547
- <CopyButton text={contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n")} />
548
- <FeedbackButton
549
- suggestionType="aeo_bullets"
550
- suggestionText={contentSuggestions.bulletListItems.join(" | ")}
551
- publication={publication}
552
- />
553
- </div>
554
- </div>
555
- </div>
556
- )}
557
-
558
- {/* Regenerate */}
559
- <button
560
- onClick={loadContentSuggestions}
561
- disabled={isCSLoading}
562
- style={{
563
- marginTop: 4,
564
- padding: "6px 12px",
565
- fontSize: 11,
566
- fontWeight: 600,
567
- color: AEO_PURPLE,
568
- background: "rgba(0,93,172,0.06)",
569
- border: "1px solid rgba(0,93,172,0.15)",
570
- borderRadius: 6,
571
- cursor: isCSLoading ? "wait" : "pointer",
572
- display: "flex",
573
- alignItems: "center",
574
- justifyContent: "center",
575
- gap: 6,
576
- }}
577
- >
578
- Regenerate
579
- </button>
580
- </div>
581
- )}
582
- </div>
583
- </div>
584
- );
585
- }