import { nothing } from "lit";
import { renderFacetValueCheckbox } from "../facet-value-checkbox/facet-value-checkbox.js";
import { renderFacetValueLabelHighlight } from "../facet-value-label-highlight/facet-value-label-highlight.js";
import { renderFacetValueLink } from "../facet-value-link/facet-value-link.js";
import { formatHumanReadable } from "./formatter.js";
const renderNumericFacetValue = ({ props })=>{
    const { facetValue, displayValuesAs, i18n, onClick } = props;
    const displayValue = formatHumanReadable(props);
    const isSelected = 'selected' === facetValue.state;
    switch(displayValuesAs){
        case 'checkbox':
            return renderFacetValueCheckbox({
                props: {
                    displayValue,
                    numberOfResults: facetValue.numberOfResults,
                    isSelected,
                    i18n,
                    onClick: ()=>onClick()
                }
            })(renderFacetValueLabelHighlight({
                props: {
                    displayValue,
                    isSelected
                }
            }));
        case 'link':
            return renderFacetValueLink({
                props: {
                    displayValue,
                    numberOfResults: facetValue.numberOfResults,
                    isSelected,
                    i18n,
                    onClick
                }
            })(renderFacetValueLabelHighlight({
                props: {
                    displayValue,
                    isSelected
                }
            }));
        default:
            return nothing;
    }
};
export { renderNumericFacetValue };
