727d86614e
P0 (7): Auth-bypass removed, migrations fixed, plugin-upload disabled, RLS FORCE+WITH CHECK, plugin double-registration fixed, persistent volume, domain removed P1 (11): User/tenant model, Redis centralized, worker separated, transactional outbox, XSS fixed, DMS chunked streaming, permissions unified, password reset, metrics secured, config/docs fixed, cross-tenant FK P2 (4): Contact model normalized, cross-imports reduced 94%, commands+state machines for contacts/dms/mail/calendar, SPA path-traversal 8 new migrations, 99 unit tests, 13 commands, 8 contracts, 72 files changed
27 lines
551 B
TypeScript
27 lines
551 B
TypeScript
import React from 'react';
|
|
import DOMPurify from 'dompurify';
|
|
import type { MessageBlock } from '@/store/commStore';
|
|
|
|
interface HtmlBlockProps {
|
|
block: MessageBlock;
|
|
}
|
|
|
|
const HtmlBlock: React.FC<HtmlBlockProps> = ({ block }) => {
|
|
const rawHtml: string = block.block_data.html || '';
|
|
|
|
if (!rawHtml) {
|
|
return null;
|
|
}
|
|
|
|
const sanitized = DOMPurify.sanitize(rawHtml);
|
|
|
|
return (
|
|
<div
|
|
className="prose prose-sm max-w-none text-inherit"
|
|
dangerouslySetInnerHTML={{ __html: sanitized }}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default HtmlBlock;
|