
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import { initializeDatabase } from './services/dataService.js'

// Inicializa o banco de dados (localStorage fallback ou Supabase check)
initializeDatabase().then(() => {
  const rootElement = document.getElementById('root');
  if (rootElement) {
    ReactDOM.createRoot(rootElement).render(
      <App />,
    )
  } else {
    console.error('Failed to find the root element');
  }
})
