import { Component } from '@angular/core';
import { ChildrenOutletContexts, RouterModule } from '@angular/router';
import { slideInAnimation } from '../../animations';
import { CommonNzModule } from '../../common.nz.module';
import { BasicDataService } from '../../services/basic.service';
import { KnowledgeService } from '../../services/knowledge.service';
import { SettingService } from '../../services/setting.service';
import { LayoutComponent } from './layout/layout.component';

@Component({
  selector: 'app-manager',
  standalone: true,
  imports: [CommonNzModule, RouterModule, LayoutComponent],
  templateUrl: './manager.component.html',
  styleUrl: './manager.component.less',
  animations: [slideInAnimation],
})
export class ManagerComponent {
  loading = false;
  constructor(
    public readonly settings: SettingService,
    private readonly basic: BasicDataService,
    private readonly knowledge: KnowledgeService,
    private contexts: ChildrenOutletContexts
  ) {
    basic.init();
    knowledge.init();
  }

  getRouteAnimationData() {
    return this.contexts.getContext('primary')?.route?.snapshot?.data?.['animation'] || '*';
  }
}
