import React, { useState } from 'react';
import { ViewsDropdown } from './ViewsDropdown';
import { setViewsState } from '../../state/setViewsState';
export const CollectionViewsDropdownBase = (props) => {
    const { toolbar, showTotal, onSelect, popoverProps, ...rest } = props;
    const [state] = useState(() => setViewsState(toolbar, rest));
    if (state == null) {
        return null;
    }
    return (React.createElement(ViewsDropdown, { dataHook: "collection-views", state: state, showTotal: showTotal, onSelect: onSelect, popoverProps: state ? popoverProps : undefined }));
};
//# sourceMappingURL=CollectionViewsDropdownBase.js.map