import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import App from './App';
import { AdminLayout } from './components/admin/AdminLayout';
import { Dashboard } from './components/admin/Dashboard';
import './index.css';

const mockUser = {
  id: '1',
  email: 'admin@example.com',
  name: 'Admin User',
  role: 'admin',
  wishlist: [],
  orders: []
};

const mockStats = {
  totalSales: 150000,
  totalOrders: 1250,
  totalUsers: 850,
  totalProducts: 120
};

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
  },
  {
    path: '/admin',
    element: <AdminLayout user={mockUser} />,
    children: [
      {
        index: true,
        element: <Dashboard stats={mockStats} />,
      },
      // Add other admin routes here
    ],
  },
]);

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <RouterProvider router={router} />
  </StrictMode>
);