import React from 'react';
import { CustomFieldsPanel } from './CustomFieldsPanel';
import { useToolbarCollectionContext } from '../ToolbarCollectionContext';

export function CustomFieldsCollectionPanelEntry() {
  const toolbar = useToolbarCollectionContext();
  const state = toolbar.collectionFieldsSource?.customFieldsPanel;
  if (!state) {
    return null;
  }
  return <CustomFieldsPanel state={state} />;
}
