diff --git a/client/src/components/BusinessReviewModal.jsx b/client/src/components/BusinessReviewModal.jsx
index 83c588c..bf729fb 100644
--- a/client/src/components/BusinessReviewModal.jsx
+++ b/client/src/components/BusinessReviewModal.jsx
@@ -59,30 +59,43 @@ function extractCdnUrls(business) {
return normalizeUniqueStrings(business?.relevantImagePaths);
}
-function normalizeScrapeLinks(value) {
- if (!Array.isArray(value)) return [];
+const DISPLAY_JSON_OMIT_KEYS = new Set([
+ 'cdnUrls',
+ 'href',
+ 'link',
+ 'links',
+ 'logos',
+ 'navigation',
+ 'screenshots',
+ 'socialLinks',
+ 'startUrl',
+ 'summaryText',
+ 'topImages',
+ 'url',
+]);
- const seen = new Set();
- return value
- .map((entry) => {
- if (typeof entry === 'string') {
- const href = normalizeText(entry);
- return href ? { href, label: href } : null;
- }
+function sanitizeDisplayJson(value) {
+ if (Array.isArray(value)) {
+ return value
+ .map((entry) => sanitizeDisplayJson(entry))
+ .filter((entry) => entry !== undefined);
+ }
- if (!entry || typeof entry !== 'object') return null;
+ if (!value || typeof value !== 'object') {
+ return value;
+ }
- const href = normalizeText(entry.href || entry.url || entry.link);
- if (!href) return null;
+ const sanitized = {};
+ Object.entries(value).forEach(([key, entryValue]) => {
+ if (DISPLAY_JSON_OMIT_KEYS.has(key)) return;
- const label = normalizeText(entry.text || entry.title || entry.label || href);
- return { href, label };
- })
- .filter((entry) => {
- if (!entry || seen.has(entry.href)) return false;
- seen.add(entry.href);
- return true;
- });
+ const nextValue = sanitizeDisplayJson(entryValue);
+ if (nextValue !== undefined) {
+ sanitized[key] = nextValue;
+ }
+ });
+
+ return sanitized;
}
function formatPrettyJson(value) {
@@ -131,7 +144,7 @@ function extractAboutText(business) {
const homepageExcerpt = normalizeText(scrapeJson?.homepage?.excerpt);
if (homepageExcerpt) return homepageExcerpt;
- return normalizeText(scrapeJson?.summaryText);
+ return '';
}
export default function BusinessReviewModal({ business, onClose }) {
@@ -144,8 +157,7 @@ export default function BusinessReviewModal({ business, onClose }) {
const colors = extractColors(business);
const aboutText = extractAboutText(business);
const cdnUrls = extractCdnUrls(business);
- const links = normalizeScrapeLinks(business?.scrapeArtifacts?.links);
- const prettyJson = useMemo(() => formatPrettyJson(business?.scrapeArtifacts?.json), [business]);
+ const prettyJson = useMemo(() => formatPrettyJson(sanitizeDisplayJson(business?.scrapeArtifacts?.json)), [business]);
useEffect(() => {
const previousBodyOverflow = document.body.style.overflow;
@@ -214,9 +226,6 @@ export default function BusinessReviewModal({ business, onClose }) {
{cdnUrls.length} image{cdnUrls.length === 1 ? '' : 's'}
-
- {links.length} link{links.length === 1 ? '' : 's'}
-
{colors.length} color{colors.length === 1 ? '' : 's'}
@@ -303,7 +312,7 @@ export default function BusinessReviewModal({ business, onClose }) {
Captured Data Raw storefront data captured during onboarding. Captured storefront data, with link-heavy fields hidden in this review. Links Every discovered storefront link is available below. {link.label} {link.href}
@@ -312,31 +321,6 @@ export default function BusinessReviewModal({ business, onClose }) {
Template Workspace
+Sample Payload
+Hardcoded event payload for previewing this template
+
+ {samplePayloadText}
+
+ Message
+ + {String(template?.selectedTemplate || '').length} characters + ++ {template?.selectedTemplate || 'No selected template yet.'} +
+Preview
+ + Sample render + ++ {renderedPreview || template?.selectedTemplate || 'Preview unavailable.'} +
+Selected Template
-- {selectedTemplatePreview.selectedTemplate} -
-