import { jsx as _jsx } from "react/jsx-runtime";
import { SelectBox } from '@vertesia/ui/core';
import { facetOptionLabel } from './utils';
export function StringFacet({ search, buckets, name, placeholder, className }) {
    const filterValue = search.getFilterValue(name);
    const onChange = (option) => {
        search.setFilterValue(name, option?._id);
    };
    const value = buckets?.find((option) => JSON.stringify(option._id) === JSON.stringify(filterValue));
    return (_jsx(SelectBox, { filterBy: "_id", className: className, isClearable: true, optionLabel: facetOptionLabel, options: buckets, value: value, onChange: onChange, by: '_id', placeholder: placeholder }));
}
//# sourceMappingURL=StringFacet.js.map