import React from 'react';

import { useToolbarCollectionContext } from '../../ToolbarCollectionContext';
import { ManageTagsModal } from './ManageTagsModal/ManageTagsModal';

export const CollectionManageTagsModal = () => {
  const toolbarState = useToolbarCollectionContext();
  const tagsModalState = toolbarState.tagsCollectionState?.tagsModalState;
  if (!tagsModalState) {
    return null;
  }
  return <ManageTagsModal state={tagsModalState} />;
};
