/** @jsx h */ import { h, Fragment } from 'preact'; import { cx } from '@algolia/ui-components-shared'; import Template from '../Template/Template'; import GeoSearchButton from './GeoSearchButton'; import GeoSearchToggle from './GeoSearchToggle'; import type { GeoSearchCSSClasses, GeoSearchTemplates, } from '../../widgets/geo-search/geo-search'; import type { ComponentCSSClasses } from '../../types'; import type { PreparedTemplateProps } from '../../lib/templating'; type Props = { cssClasses: ComponentCSSClasses; enableRefine: boolean; enableRefineControl: boolean; enableClearMapRefinement: boolean; isRefineOnMapMove: boolean; isRefinedWithMap: boolean; hasMapMoveSinceLastRefine: boolean; onRefineToggle(event: Event): void; onRefineClick(event: MouseEvent): void; onClearClick(event: MouseEvent): void; templateProps: PreparedTemplateProps; }; const GeoSearchControls = ({ cssClasses, enableRefine, enableRefineControl, enableClearMapRefinement, isRefineOnMapMove, isRefinedWithMap, hasMapMoveSinceLastRefine, onRefineToggle, onRefineClick, onClearClick, templateProps, }: Props) => ( {enableRefine && (
{enableRefineControl && (
{isRefineOnMapMove || !hasMapMoveSinceLastRefine ? (