export function createDragGhost(el) {
  function show(e, text) {
    el.textContent = text;
    el.style.display = 'block';
    move(e);
  }

  function move(e) {
    el.style.left = `${e.clientX + 16}px`;
    el.style.top = `${e.clientY - 14}px`;
  }

  function hide() {
    el.style.display = 'none';
  }

  function setText(text) {
    el.textContent = text;
  }

  function isHidden() {
    return el.style.display === 'none';
  }

  return { hide, isHidden, move, setText, show };
}
