admesh-ui-sdk
Version:
Beautiful, modern React components for displaying AI-powered product recommendations with citation-based conversation ads, auto-triggered widgets, floating chat, conversational interfaces, persistent sidebar, and built-in tracking. Includes zero-code SDK
45 lines • 1.75 kB
TypeScript
import { default as React } from 'react';
export interface WeaveAdFormatContainerProps {
/** Unique ID for this message container */
messageId: string;
/** The LLM response content (may contain AdMesh links) */
children: React.ReactNode;
/** Fallback format if no links detected (default: 'tail') */
fallbackFormat?: 'product' | 'tail';
/** Optional callback when AdMesh links are detected */
onLinksDetected?: (count: number) => void;
/** Optional callback when no links are detected (fallback should be rendered) */
onNoLinksDetected?: () => void;
/** Optional callback on error */
onError?: (error: Error) => void;
/** Optional CSS class for the container */
className?: string;
/** Optional query text for fallback API calls (used when no links are detected) */
query?: string;
/** Optional callback to notify parent when fallback state changes */
onFallbackChange?: (shouldFallback: boolean) => void;
}
/**
* WeaveAdFormatContainer - Automatic Weave Ad Format handling component
*
* Wraps LLM response content and automatically:
* - Detects AdMesh links in the content
* - Fires exposure tracking for detected links
* - Adds [Ad] labels to links
* - Shows "Why this ad?" tooltip on hover
* - Provides context for WeaveFallbackRecommendations component
*
* @example
* ```tsx
* <WeaveAdFormatContainer
* messageId={message.id}
* query={userQuery}
* onLinksDetected={(count) => console.log(`Found ${count} ads`)}
* >
* {llmResponseContent}
* </WeaveAdFormatContainer>
* ```
*/
export declare const WeaveAdFormatContainer: React.FC<WeaveAdFormatContainerProps>;
export default WeaveAdFormatContainer;
//# sourceMappingURL=WeaveAdFormatContainer.d.ts.map