import React, { type FC } from "react"; import type { TamboComponentContent } from "../types/message.js"; export interface ComponentRendererProps { /** * The component content block from a message */ content: TamboComponentContent; /** * The thread ID the component belongs to */ threadId: string; /** * The message ID the component belongs to */ messageId: string; /** * Optional fallback to render if component is not found in registry */ fallback?: React.ReactNode; } /** * Renders a component from the registry based on component content block data. * * Use this component in your message renderer to display AI-generated components. * The component instance is preserved across re-renders as long as React's * reconciliation keeps this wrapper mounted (use content.id as key). * * Wraps the rendered component with ComponentContentProvider so that hooks * like useTamboComponentState can access component context. * @returns The rendered component wrapped in ComponentContentProvider, or fallback if not found * @example * ```tsx * function MessageContent({ content }: { content: Content }) { * if (content.type === 'component') { * return ( * Unknown component: {content.name}} * /> * ); * } * // ... handle other content types * } * ``` */ export declare const ComponentRenderer: FC; //# sourceMappingURL=v1-component-renderer.d.ts.map