/**
 * Single-source HTML sanitizer for merchant-authored content.
 *
 * Brainerce returns RICH_TEXT.html, PAGE.html, and FAQ answer values as raw
 * HTML — the server does NOT pre-sanitize because some merchants embed
 * iframes (e.g. YouTube). Run every merchant-authored HTML string through
 * this wrapper before injecting via `dangerouslySetInnerHTML`.
 *
 *   const safe = sanitizeHtml(rawHtml);
 *   <div dangerouslySetInnerHTML={{ __html: safe }} />
 *
 * DOM-free (see ./sanitizer.ts), so the same call works in Server Components,
 * Client Components and on Cloudflare Workers.
 */
import { sanitizeContent } from './sanitizer';

export function sanitizeHtml(html: string | null | undefined): string {
  if (!html) return '';
  return sanitizeContent(html);
}
