import React from 'react';

import { FiltersMap } from '@wix/bex-core';

import {
  CollectionViewsDropdownBase,
  CollectionViewsDropdownBaseProps,
} from './CollectionViewsDropdownBase';
import { ToolbarCollectionState } from '../../state';

export interface CollectionViewsDropdownStandaloneProps<F extends FiltersMap>
  extends Omit<CollectionViewsDropdownBaseProps<F>, 'toolbar'> {
  state: { toolbar: ToolbarCollectionState<any, F> };
}

export const CollectionViewsDropdownStandalone = <F extends FiltersMap>(
  props: CollectionViewsDropdownStandaloneProps<F>,
) => {
  const { state, ...rest } = props;
  return <CollectionViewsDropdownBase toolbar={state.toolbar} {...rest} />;
};
