import { Routes,RouterModule } from '@angular/router';
import { PostPageComponent } from './post-page/post-page.component'; // 导入 PostPage 组件
import { CommunityPage } from './community/community.page';
import { SharePageComponent } from './share-page/share-page.component';
import { NgModule } from '@angular/core';
export const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
  },
  {

    path: 'community',
    loadComponent: () => import('./community/community.page').then( m => m.CommunityPage)
  },
  { path: '', redirectTo: 'community', pathMatch: 'full' },
  { path: 'community', component: CommunityPage },
  { path: 'post-page/:id', component: PostPageComponent }, // 动态详情页面的路由
  { path: 'share', component: SharePageComponent },

    {path: 'login-page',
    loadComponent: () =>
      import('./page/login-page/login-page.page').then((m) => m.LoginPagePage),
  },
  {
    path: 'register-page',
    loadComponent: () =>
      import('./page/register-page/register-page.page').then(
        (m) => m.RegisterPagePage
      ),
  },
  {
    path: 'modal-edit-page',
    loadComponent: () => import('./page/modal-edit-page/modal-edit-page.page').then( m => m.ModalEditPagePage)
  },

];


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