import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PageCartComponent } from './page-cart/page-cart.component';
import { HomeComponent } from './home/home.component';
import { PageMineComponent } from './page-mine/page-mine.component';
import { NavTabsComponent } from './nav-tabs/nav-tabs.component';
import { PageDiscoverComponent } from './page-discover/page-discover.component';
import { PageItemDetailComponent } from './page-item-detail/page-item-detail.component';
import { PageChatPanelComponent } from './page-chat-panel/page-chat-panel.component';
import { PageLoginComponent } from './page-login/page-login.component';


const routes: Routes = [
  {
    path:"",component:NavTabsComponent,
    children:[
      { path:"home", component:HomeComponent },
      { path:"page-cart", component:PageCartComponent },
      { path:"page-mine", component:PageMineComponent },
      { path:"page-login", component:PageLoginComponent },
      { path:"page-discover", component:PageDiscoverComponent },
      { path:"page-item-detail/:name", component:PageItemDetailComponent },
      {path:"page-chat-panel",component:PageChatPanelComponent},
    ]
  },
  { path: 'detail', component: PageItemDetailComponent },
  { path: '**', redirectTo: 'home', pathMatch: 'full' }
];

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