import { CollectionViewsState } from './CollectionViewsState';
import { presetsToCategories } from './presetsToCategories';
export function setViewsState(toolbar, viewsProps) {
    const { presets, onSaveView, onSaveViewChanges, onDeleteView, onRenameView, onSetAsDefaultView, allItemsViewProps, learnMoreLink, viewNamePlaceholder, } = viewsProps;
    const { container } = toolbar;
    if (container.isPanelLayout) {
        return null;
    }
    return (toolbar.viewsState ??= new CollectionViewsState({
        table: toolbar,
        container,
        presets: presetsToCategories(presets),
        allItemsViewProps,
        onDeleteView,
        onSaveView,
        onSaveViewChanges,
        onSetAsDefaultView,
        onRenameView,
        learnMoreLink,
        viewNamePlaceholder,
    }));
}
//# sourceMappingURL=setViewsState.js.map