import { MainManagerContentComponent } from './../../content/main-manager-content/main-manager-content.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MainDashboardContentComponent } from '../../content/main-dashboard-content/main-dashboard-content.component';
import { MainReportComponent } from '../../component/main-report/main-report.component';
import { BudgetAproval } from '../../component/budget-aproval/budget-aproval';
import { MainLandingComponent } from '../../component/main-landing/main-landing.component';
// import { MainReportComponent } from '../../component/main-report/main-report.component';



const routes: Routes = [
  { path: 'landing', component: MainLandingComponent },
  { path: 'dashboard', component: MainDashboardContentComponent },
  { path: 'report', component: MainReportComponent },
  { path: 'manager', component: MainManagerContentComponent },
    {
    path: 'manager',
    children: [
      { path: '', component: MainManagerContentComponent }, // รายการโครงการ
      { path: 'budget/:code', component: BudgetAproval },   // จัดการงบประมาณ
    ]
  },
     // children: [
      // {
      //   path: 'dashboard',
      //   // loadChildren: () => import('./controls/profile-control/profile-control.module').then(m => m.ProfileControlModule)
      // },
  // { path: 'report',  component: MainReportComponent },
      // { path: '', redirectTo: 'profile', pathMatch: 'full' }
    // ]

  { path: '', redirectTo: 'landing', pathMatch: 'full' },
  { path: '**', redirectTo: 'landing' }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class MainControlRoutingModule { }
