UNPKG

posthog-js

Version:

Posthog-js allows you to automatically capture usage and send events to PostHog.

25 lines (24 loc) • 1.02 kB
import { h } from 'preact'; import { TipTapDoc } from '../../../../posthog-conversations-types'; interface RichContentProps { /** Rich content in TipTap JSON format (preferred) */ richContent?: TipTapDoc; /** Plain text fallback if rich_content is missing or invalid */ content: string; /** Whether message is from customer (affects styling) */ isCustomer: boolean; /** Primary color for links */ primaryColor: string; /** Recognize simple [label](url) links in the greeting's text fallback only. */ isGreeting?: boolean; } /** * RichContent component - renders TipTap JSON content with plain text fallback * * Rendering logic: * 1. If richContent is present and valid, render as TipTap tree * 2. Otherwise render text, recognizing simple inline links only for greetings * 3. Wrap TipTap rendering in try/catch for safety */ export declare function RichContent({ richContent, content, isCustomer, primaryColor, isGreeting }: RichContentProps): h.JSX.Element; export {};