import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '../guards/auth.guard';
import { KendoModule } from '../shared/kendo.module';
import { LottieModule } from 'ngx-lottie';
import player from 'lottie-web';
import { PermissionUserComponent } from './permission-user/permission-user.component';
import { ComponentModule } from '../components/component.module'; // Importando o módulo correto

export function playerFactory() {
  return player;
}

const routes: Routes = [
  { path: 'permission-user', component: PermissionUserComponent, canActivate: [AuthGuard] },
];

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(routes),
    KendoModule,
    LottieModule.forRoot({ player: playerFactory }),
    ComponentModule, // Importa o módulo que contém HeaderAdminComponent
  ],
  declarations: [PermissionUserComponent], // Apenas componentes exclusivos deste módulo
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AdminModule {}
