UNPKG

instantsearch-ui-components

Version:

Common UI components for InstantSearch.

44 lines (43 loc) 1.67 kB
import type { Renderer, ComponentProps } from '../../types'; import type { ChatHeaderProps, ChatHeaderOwnProps } from './ChatHeader'; import type { ChatMessagesProps } from './ChatMessages'; import type { ChatPromptProps, ChatPromptOwnProps } from './ChatPrompt'; import type { ChatToggleButtonOwnProps, ChatToggleButtonProps } from './ChatToggleButton'; export type ChatClassNames = { root?: string | string[]; container?: string | string[]; header?: ChatHeaderProps['classNames']; messages?: ChatMessagesProps['classNames']; message?: ChatMessagesProps['messageClassNames']; prompt?: ChatPromptProps['classNames']; toggleButton?: ChatToggleButtonProps['classNames']; }; export type ChatProps = Omit<ComponentProps<'div'>, 'onError' | 'title'> & { open: boolean; maximized?: boolean; headerProps: ChatHeaderProps; toggleButtonProps: ChatToggleButtonProps; messagesProps: ChatMessagesProps; promptProps: ChatPromptProps; /** * Optional class names for elements */ classNames?: Partial<ChatClassNames>; /** * Optional title for the chat */ title?: string; /** * Optional header component for the chat */ headerComponent?: (props: ChatHeaderOwnProps) => JSX.Element; /** * Optional prompt component for the chat */ promptComponent?: (props: ChatPromptOwnProps) => JSX.Element; /** * Optional toggle button component for the chat */ toggleButtonComponent?: (props: ChatToggleButtonOwnProps) => JSX.Element; }; export declare function createChatComponent({ createElement, Fragment }: Renderer): (userProps: ChatProps) => JSX.Element;