import { lazy } from 'react';
const LogIn = lazy(() => import('../pages/Auth/Login'));
const MyProducts = lazy(() => import('../pages/Inventory/MyProducts'));
const ProductCategories = lazy(() => import('../pages/Inventory/ProductCategories'));
const ProductCollections = lazy(() => import('../pages/Inventory/ProductCollections'));
const ProductColors = lazy(() => import('../pages/Inventory/ProductColors'));
const ProductSizes = lazy(() => import('../pages/Inventory/ProductSizes'));
import { paths } from '../config/paths';
import { ProtectedRoute } from '../lib/auth';
const Index = lazy(() => import('../pages/Index'));
const NotFound = lazy(() => import('../pages/NotFound'));

const routes = [
    // auth
    {
        path: paths.auth.login.path,
        element: <LogIn />,
        layout: 'blank',
    },
    // dashboard
    {
        path: paths.dashboard.path,
        element: (
            <ProtectedRoute>
                <Index />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    // inventory
    {
        path: paths.inventory.myProducts.path,
        element: (
            <ProtectedRoute>
                <MyProducts />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    {
        path: paths.inventory.productCategories.path,
        element: (
            <ProtectedRoute>
                <ProductCategories />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    {
        path: paths.inventory.productCollections.path,
        element: (
            <ProtectedRoute>
                <ProductCollections />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    {
        path: paths.inventory.productColors.path,
        element: (
            <ProtectedRoute>
                <ProductColors />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    {
        path: paths.inventory.productSizes.path,
        element: (
            <ProtectedRoute>
                <ProductSizes />
            </ProtectedRoute>
        ),
        layout: 'default',
    },
    // not found
    {
        path: '*',
        element: <NotFound />,
        layout: 'blank',
    },
];

export { routes };
