UNPKG

react-instantsearch

Version:
25 lines (24 loc) 1.31 kB
import React from 'react'; import type { PromptSuggestionsOwnProps } from 'instantsearch-ui-components'; import type { UsePromptSuggestionsProps } from 'react-instantsearch-core'; /** * Props passed to a custom `layoutComponent`. Mirrors the connector render * state so a layout component owns the full markup. */ export type PromptSuggestionsLayoutComponentProps = { suggestions: string[]; isLoading: boolean; error: Error | undefined; onSuggestionClick: (prompt: string) => void; isChatBusy: boolean; }; export type PromptSuggestionsOnSuggestionClick = (prompt: string, helpers: { sendToChat: (prompt: string) => boolean; }) => void; type OwnedUiProps = 'suggestions' | 'isLoading' | 'onSuggestionClick' | 'disabled' | 'skeletonCount'; export type PromptSuggestionsProps = Omit<PromptSuggestionsOwnProps, OwnedUiProps> & UsePromptSuggestionsProps & { layoutComponent?: (props: PromptSuggestionsLayoutComponentProps) => JSX.Element | null; onSuggestionClick?: PromptSuggestionsOnSuggestionClick; }; export declare function PromptSuggestions({ classNames, layoutComponent: LayoutComponent, onSuggestionClick: onSuggestionClickOverride, agentId, transport, configurationId, transformHits, context, transformItems, ...props }: PromptSuggestionsProps): React.JSX.Element; export {};