react-instantsearch
Version:
⚡ Lightning-fast search for React, by Algolia
35 lines (34 loc) • 1.5 kB
TypeScript
import React from 'react';
import type { CompareBarClassNames, CompareBarItemComponentProps, CompareBarTranslations } from 'instantsearch-ui-components';
import type { UseCompareProps } from 'react-instantsearch-core';
export type CompareBarProps = UseCompareProps & {
/**
* ID of the comparison configuration created in the Agent Studio dashboard
* (Components > Comparison). The bar's "Compare" call-to-action sends its
* placeholder to the chat, which the backend resolves into the
* configuration's instructions; the chat shows no user message for it.
*/
configurationId: string;
/**
* CSS classes to add to the widget elements.
*/
classNames?: Partial<CompareBarClassNames>;
/**
* Translations for the widget's texts.
*/
translations?: Partial<CompareBarTranslations>;
/**
* Custom renderer for a selected item's label.
*/
itemComponent?: (props: CompareBarItemComponentProps) => JSX.Element;
};
/**
* Renders the comparison selection bar: the records picked for comparison,
* a clear-selection action, and the "Compare" call-to-action that opens the
* `<Chat>` widget with the configured comparison.
*
* Select records from your own UI (e.g. a "Compare" button in your hit
* component) with `useCompare().toggleItem(hit)` — the selection is shared
* with this widget.
*/
export declare function CompareBar({ classNames, translations, itemComponent, ...props }: CompareBarProps): React.JSX.Element;