import { Routes } from '@angular/router';
import { authGuard } from './core/guards/auth.guard';
export const routes: Routes = [
{
path: 'login',
loadComponent: () => import('./features/login/login.component').then(m => m.LoginComponent)
},
{
path: '',
loadComponent: () => import('./features/layout/main-layout/main-layout.component').then(m => m.MainLayoutComponent),
canActivate: [authGuard],
children: [
{
path: 'dashboard',
loadComponent: () => import('./features/dashboard/dashboard.component').then(m => m.DashboardComponent)
},
{
path: 'orders',
loadComponent: () => import('./features/orders/orders.component').then(m => m.OrdersComponent)
},
{
path: 'invoices',
loadComponent: () => import('./features/invoices/invoices.component').then(m => m.InvoicesComponent)
},
{
path: 'customers',
loadComponent: () => import('./features/customers/customers.component').then(m => m.CustomersComponent)
},
{
path: 'products',
loadComponent: () => import('./features/products/products.component').then(m => m.ProductsComponent)
},
{
path: 'chat',
loadComponent: () => import('./features/chat/chat.component').then(m => m.ChatComponent)
},
{
path: '',
redirectTo: 'dashboard',
pathMatch: 'full'
}
]
},
{
path: '**',
redirectTo: 'login'
}
];