import { createBrowserRouter } from "react-router-dom"
import Channels from "@/admin/channels/page"
import CouponPage from "@/admin/coupon/page"
import Dashboard from "@/admin/dashboard/page"
import Funds from "@/admin/funds/page"
import HttpRechargePage from "@/admin/httpRecharge/page"
import AdminLayout from "@/admin/layout"
import OrdersPage from "@/admin/orders/page"
import RecordPage from "@/admin/record/page"
import RefundOrdersPage from "@/admin/refundOrders/page"
import LongPage from "@/admin/resources/long"
import ShortPage from "@/admin/resources/short"
import RosorderPage from "@/admin/rosorder/page"
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 BuyPage from "@/home/product/buy"
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/buy", element: <BuyPage /> },
      { 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 /> },
        ],
      },
      { path: "orders", element: <OrdersPage /> },
      { path: "refundOrders", element: <RefundOrdersPage /> },
      { path: "httpRecharge", element: <HttpRechargePage /> },
      { path: "record", element: <RecordPage /> },
      { path: "coupon", element: <CouponPage /> },
      { path: "resources/long", element: <LongPage /> },
      { path: "resources/short", element: <ShortPage /> },
      { path: "rosorder", element: <RosorderPage /> },
    ],
  },
])
