import { EL_PICKER_PANEL_FOOTER } from './constants';

export const createExtraWrapper = (
  elPopperEl: HTMLElement | null,
  className: string
) => {
  const panelFooterEl = elPopperEl?.querySelector(`.${EL_PICKER_PANEL_FOOTER}`);
  const firstButton = panelFooterEl?.querySelectorAll('button')[0];

  // 创建一个额外的 div 容器
  const container = document.createElement('div');
  container.className = className;
  container.style.display = 'none';
  if (firstButton && panelFooterEl)
    panelFooterEl.insertBefore(container, firstButton);
  return container;
};
