import Stats from 'stats.js';

export default function createStats(container: string) {
  const stats = new Stats();
  stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
  document.querySelector(`.${container}__stats-wrapper`)?.remove();
  document.getElementById(container)?.appendChild(stats.dom);
  stats.dom.className = `.${container}__stats-wrapper`;
  stats.dom.style.cssText =
    'position: absolute; bottom: 0px; right: 0px; cursor: pointer; opacity: 0.9; z-index: 10000;';
  return stats;
}
