import { createBrowserRouter } from "react-router-dom";
import { AuthLayout } from "../components/ui/auth/layout";
import App from "../App";
import { Login } from "../pages/auth/login";
import { ForgotPassword } from "../pages/auth/forgot-password";
import { Register } from "../pages/auth/register";
import { ResetPassword } from "../pages/auth/reset-password";
import { LoginWithCode } from "../pages/auth/login-with-code";
import { SendCode } from "../pages/auth/send-code";
import { ResetPasswordCode } from "../pages/auth/reset-password-code";
import { DashboardLayout } from "../components/ui/dashboard/layout";
import { MyAcccount } from "../pages/dashboard/my-account";
import { Wallet } from "../pages/dashboard/wallet";
import { ManagementBankAccountPage } from "../pages/dashboard/management-bank-account";
import { InstallationReportsPage } from "../pages/dashboard/installation-reports";
import { TransactionsPage } from "../pages/dashboard/transactions";
import { ScorePage } from "../pages/dashboard/score";
import { SubscriptionReportPage } from "../pages/dashboard/subscription-report";
import { AwardsPage } from "../pages/dashboard/awards";
import { Guard } from "../guard";


export const router = createBrowserRouter([
    {
        element: <Guard><DashboardLayout /></Guard>,
        path: "/",
        children: [
            {
                index: true,
                element: <App />
            },
            {
                path: "my-account",
                element: <MyAcccount />
            },
            {
                path: "wallet",
                element: <Wallet />
            },
            {
                path: "management-bank-accounts",
                element: <ManagementBankAccountPage />
            },
            {
                path: "installation-reports",
                element: <InstallationReportsPage />
            },
            {
                path: "transactions",
                element: <TransactionsPage />
            },
            {
                path: "my-score",
                element: <ScorePage />
            },
            {
                path: "subscription-report",
                element: <SubscriptionReportPage />
            },
            {
                path: "awards",
                element: <AwardsPage />
            },
        ]
    },
    {
        element: <AuthLayout />,
        path: "/auth",
        children: [
            {
                path: "login",
                element: <Login />
            },
            {
                path: "forgot-password",
                element: <ForgotPassword />
            },
            {
                path: "register",
                element: <Register />
            },
            {
                path: "reset-password",
                element: <ResetPassword />
            },
            {
                path: "login-with-code",
                element: <LoginWithCode />
            },
            {
                path: "send-code",
                element: <SendCode />
            },
            {
                path: "reset-password-code",
                element: <ResetPasswordCode />
            },
        ]
    }
])