import React from 'react'; import { useHits } from 'react-instantsearch-hooks'; import { Hits as HitsUiComponent } from '../ui/Hits'; import type { HitsProps as HitsUiComponentProps } from '../ui/Hits'; import type { Hit, BaseHit } from 'instantsearch.js'; import type { UseHitsProps } from 'react-instantsearch-hooks'; type UiProps = Pick< HitsUiComponentProps>, 'hits' | 'sendEvent' >; export type HitsProps = Omit< HitsUiComponentProps>, keyof UiProps > & UseHitsProps; export function Hits({ escapeHTML, transformItems, ...props }: HitsProps) { const { hits, sendEvent } = useHits( { escapeHTML, transformItems }, { $$widgetType: 'ais.hits' } ); const uiProps: UiProps = { hits, sendEvent, }; return ; }