import { createRoot } from 'react-dom/client';
import App from './App';

import { ThemeProvider, CssBaseline } from '@mui/material';
import { defaultTheme } from '../theme/themes'; // <-- поправь путь, если themes.ts лежит в другом месте

const container = document.getElementById('root') as HTMLElement;
const root = createRoot(container);

root.render(
  <ThemeProvider theme={defaultTheme}>
    <CssBaseline />
    <App />
  </ThemeProvider>,
);

// calling IPC exposed from preload script
window.electron?.ipcRenderer.once('ipc-example', (arg) => {
  // eslint-disable-next-line no-console
  console.log(arg);
});
window.electron?.ipcRenderer.sendMessage('ipc-example', ['ping']);
