import React from "react";
import { createHashRouter, RouterProvider, Outlet } from "react-router-dom";
import { ProtectedRoute, LoginPage, AuthCallback } from "@domains/auth";
import { Dashboard } from "@domains/dashboard";
import { MainLayout } from "@shared/ui";

// Define routes
const router = createHashRouter([
  {
    path: "/",
    element: (
      <ProtectedRoute>
        <MainLayout>
          <Outlet />
        </MainLayout>
      </ProtectedRoute>
    ),
    children: [
      {
        index: true,
        element: <Dashboard />,
      }
    ],
  },
  {
    path: "/login",
    element: <LoginPage />,
  },
  {
    path: "/auth/callback",
    element: <AuthCallback />,
  },
  // Add other routes as needed
]);

export const AppRouter: React.FC = () => {
  return <RouterProvider router={router} />;
};
