import { createRoot, hydrateRoot } from 'react-dom/client';
import App from './App';
import './index.css';
import { initPlausible } from './hooks/usePlausible';

initPlausible();

const container = document.getElementById('root');
if (!container) {
  throw new Error('Root element not found');
}

if (container.children.length > 0) {
  hydrateRoot(container, <App />);
} else {
  createRoot(container).render(<App />);
}
