import React from 'react';
import { observer } from 'mobx-react-lite';
import { MultiInlineCheckboxFilter } from '../MultiInlineCheckboxFilter';
import { MultiSelectCheckboxFilter } from '../MultiSelectCheckboxFilter';
import { useFilterRenderingContext } from '../FilterRenderingContext';
import { useStaticListFilterCollection } from '../../hooks/useStaticListFilterCollection';
const MAX_INLINE_ITEMS = 10;
function _MultiAutoInlineCheckboxFilter(props) {
    const { maxInlineItems = MAX_INLINE_ITEMS, data, filter, ...rest } = props;
    const { location } = useFilterRenderingContext();
    const shouldBeRenderedAsDropdown = location === 'toolbar' || data.length > maxInlineItems;
    const collection = useStaticListFilterCollection(filter, data);
    return shouldBeRenderedAsDropdown ? (React.createElement(MultiSelectCheckboxFilter, { ...rest, collection: collection, filter: filter })) : (React.createElement(MultiInlineCheckboxFilter, { ...rest, filter: filter, data: data }));
}
export const MultiAutoInlineCheckboxFilter = observer(_MultiAutoInlineCheckboxFilter);
//# sourceMappingURL=MultiAutoInlineCheckboxFilter.js.map