import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import AppWithProviders from './AppWithProviders.jsx'
import { debugEnvironment } from './utils/envDebug.js'
import { printer } from './utils/electronPrinter.js'

// Debug environment configuration
if (import.meta.env.MODE === 'development') {
  debugEnvironment();
}

// Initialize Electron printer bridge for backward compatibility
if (typeof window !== 'undefined') {
  window.printer = printer;
  console.log('[BaristaFlow] Electron printer bridge initialized:', printer.isAvailable());
}

createRoot(document.getElementById('root')).render(
  <StrictMode>
    <AppWithProviders />
  </StrictMode>,
)
