import React from 'react';
import {
InstantSearch,
Hits,
Stats,
Pagination,
RatingMenu,
Highlight,
Configure,
connectSearchBox,
connectRefinementList,
} from 'react-instantsearch-dom';
import algoliasearch from 'algoliasearch/lite';
import withURLSync from './URLSync';
import './App.css';
const searchClient = algoliasearch(
'latency',
'6be0576ff61c053d5f9a3225e2a90f76'
);
const App = (props) => (
);
const Header = () => (
);
const SearchBox = connectSearchBox(({ currentRefinement, refine }) => (
));
const Facets = () => (
);
const Panel = ({ title, children, id }) => (
{title}
{children}
);
const Star = ({ active }) => (
);
const Stars = ({ rating }) => {
const stars = [];
for (let i = 1; i <= 5; ++i) {
stars.push(i <= rating);
}
return (
{stars.map((active, idx) => (
))}
);
};
const Genre = ({ name }) => {name};
const Genres = ({ genres }) => (
{genres.map((genre, idx) => (
))}
);
const Hit = (hit) => {
const { image, rating, year, genre } = hit.hit;
return (
);
};
const Results = connectSearchBox(() => (
));
const RefinementListLinks = connectRefinementList(
({ items, refine, createURL }) => {
const hitComponents = items.map((item) => (
));
return {hitComponents}
;
}
);
export default withURLSync(App);