import { Hit as AlgoliaHit } from 'instantsearch.js'; import algoliasearch from 'algoliasearch/lite'; import React from 'react'; import { InstantSearch, Breadcrumb, Configure, ClearRefinements, CurrentRefinements, DynamicWidgets, HierarchicalMenu, Highlight, Hits, HitsPerPage, InfiniteHits, Menu, Pagination, RangeInput, RefinementList, PoweredBy, SearchBox, SortBy, ToggleRefinement, } from 'react-instantsearch-hooks-web'; import { Panel, QueryRuleContext, QueryRuleCustomData, Refresh, } from './components'; import { Tab, Tabs } from './components/layout'; import './App.css'; const searchClient = algoliasearch( 'latency', '6be0576ff61c053d5f9a3225e2a90f76' ); type HitProps = { hit: AlgoliaHit<{ name: string; price: number; }>; }; function Hit({ hit }: HitProps) { return ( <> ${hit.price} > ); } export function App() { return ( items.map((item) => { const label = item.label.startsWith('hierarchicalCategories') ? 'Hierarchy' : item.label; return { ...item, attribute: label, }; }) } /> ['Apple'], }} /> {({ items }) => ( <> {items.map((item) => ( ))} > )} ); }