Files
co-lite/solvway-admin-portal/app/components/pages/SafeHtml.tsx
T
ngqileandClaude Opus 5.5 bb2c5c5db7 feat(portal): landing pages list, editor, preview and public page
Pages list and Tiptap editor (ported from babyboo) with image upload on
save, the FORM event picker, field errors at their fields, delete
confirmation, unsaved-edits guard and a draft preview. The public page
/p/<company>/<slug> renders on the server with metadata, sanitize-html,
the company's logo and accent, and the sign-up form with UTM tags.
Companies get branding; the event lead detail shows the web page and
campaign. Labels in English and Chinese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
2026-12-02 16:30:54 +08:00

8 lines
465 B
TypeScript

import { sanitizePageHtml } from "@/app/lib/pageHtml";
// The only place a landing page renders HTML: page authors' rich text, sanitised with the allow-list in pageHtml.ts.
// Deliberately free of i18n imports (noDangerouslySetInnerHtml sweep: catalog text is never markup).
export function SafeHtml({ html, className }: { html: string; className?: string }) {
return <div className={className} dangerouslySetInnerHTML={{ __html: sanitizePageHtml(html) }} />;
}