import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { AuthGuard } from "app/auth-guard.service";
import { Board001CreateBoardComponent } from "./board001/board001-create-board.component";
import { Board001Resolver } from "./board001/board001-resolver.service";
import { Board001SetBoardComponent } from "./board001/board001-set-board.component";
import { Board001ViewBoardComponent } from "./board001/board001-view-board.component";
import { Board001Component } from "./board001/board001.component";




const routes: Routes = [
  {
    path: "",
    data: {
      title: "公佈欄管理"
    },
    children: [
      {
        path: "board001",
        component: Board001Component,
        resolve: { selectedItem: Board001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "公佈欄設定"
        }
      },
      {
        path: "board001-create-board",
        component: Board001CreateBoardComponent,
        canActivate: [AuthGuard],
        data: {
          title: "新增公佈欄資料"
        }
      },
      {
        path: "board001-set-board",
        component: Board001SetBoardComponent,
        resolve: { selectedItem: Board001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "修改公佈欄資料"
        }
      },
      {
        path: "board001-view-board",
        component: Board001ViewBoardComponent,
        resolve: { selectedItem: Board001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "詳細公佈欄資料"
        }
      }
    ]
  }
];

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