import { createBrowserRouter } from "react-router-dom"
import Channels from "@/admin/channels/page"
import Dashboard from "@/admin/dashboard/page"
import Funds from "@/admin/funds/page"
import AdminLayout from "@/admin/layout"
import LongPage from "@/admin/product/long"
import ShortPage from "@/admin/product/short"
import Whitelist from "@/admin/whitelist/page"
import AuthGuard from "@/components/authGuard"
import HomePage from "@/home"
import ClientPage from "@/home/client"
import HelpPage from "@/home/help"
import IpLinePage from "@/home/ipLine"
import LayoutPage from "@/home/layout"
import LoginPage from "@/home/login"
import ProductPage from "@/home/product"
import HttpPage from "@/home/product/http"
import RouterosPage from "@/home/product/routeros"
import SoftDownloadPage from "@/home/softDownload"
export const router = createBrowserRouter([
  {
    path: "/",
    element: <LayoutPage />,
    children: [
      { index: true, element: <HomePage /> },
      { path: "product", element: <ProductPage /> },
      { path: "product/http", element: <HttpPage /> },
      { path: "product/routeros", element: <RouterosPage /> },
      { path: "ipline", element: <IpLinePage /> },
      { path: "softdownload", element: <SoftDownloadPage /> },
      { path: "help", element: <HelpPage /> },
      { path: "client", element: <ClientPage /> },
    ],
  },
  {
    path: "/login",
    element: <LoginPage />,
  },
  {
    path: "/admin",
    element: (
      <AuthGuard>
        <AdminLayout />
      </AuthGuard>
    ),
    children: [
      { index: true, element: <Dashboard /> },
      { path: "channels", element: <Channels /> },
      { path: "whitelist", element: <Whitelist /> },
      { path: "funds", element: <Funds /> },
      {
        path: "product",
        children: [
          { path: "long", element: <LongPage /> },
          { path: "short", element: <ShortPage /> },
        ],
      },
    ],
  },
])
