
import { Navigate } from "react-router-dom";

import Customers from "../pages/Customers/Customers.jsx";
import Dashboard from "../pages/Dashboard/Dashboard.jsx";
import Layout from "../layouts/Layout.jsx";
import Ledger from "../pages/Ledger/Ledger.jsx";
import Reports from "../pages/Reports/Reports.jsx";
import Settings from "../pages/Settings/Settings.jsx";
import Transactions from "../pages/Transactions/Transactions.jsx";
import Cashbook from "../pages/Cashbook/Cashbook.jsx";
import Expenses from "../pages/Expenses/Expenses.jsx";
import ProtectedRoute from "./ProtectedRoute.jsx";

const user = { name: "Ram", avatar: "R" };
const isAuthenticated = true;

export const RouteDefinitions = [
  {
    path: "/",
    element: <Layout user={user} />,
    children: [
      {
        index: true,
        element: <Navigate to="dashboard" replace />
      },
      {
        path: "dashboard",
        element: <Dashboard user={user} />
      },
      {
        path: "ledger",
        element: (
          <ProtectedRoute isAuth={isAuthenticated}>
            <Ledger user={user} />
          </ProtectedRoute>
        )
      },
      {
        path: "expenses",
        element: <Expenses user={user} />
      },
      {
        path: "transactions",
        element: <Transactions user={user} />
      },
      {
        path: "customers",
        element: <Customers user={user} />
      },
      {
        path: "reports",
        element: <Reports user={user} />
      },
      {
        path: "settings",
        element: <Settings user={user} />
      },
      {
        path: "cashbook",
        element: <Cashbook />
      }
    ]
  }
];
