import { Component, OnInit, ViewChild } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { CommonCompModule } from '../../../services/common.modules';
import { CompTableListComponent } from '../../../app/comp-table/comp-table-list/comp-table-list.component';
import { EduTextbook } from '../../../schemas/EduTextbook';
import * as Parse from 'parse';
import { CommonModule } from '@angular/common';

@Component({
  selector: 'app-approve',
  imports: [
    CommonCompModule,
    CommonModule,
    RouterOutlet,
    CompTableListComponent,
  ],
  standalone: true,
  templateUrl: './approve.component.html',
  styleUrls: ['./approve.component.scss'],
})
export class ApproveComponent implements OnInit {
  @ViewChild(CompTableListComponent) list: CompTableListComponent | undefined;

  EduTextbook = EduTextbook;
  user: Parse.User | undefined;
  className: string | undefined;
  queryParams: any | undefined;
  fieldsArray: Array<any> | undefined;

  constructor() {
    this.user = Parse.User.current();
    this.className = this.EduTextbook.className;
    this.fieldsArray = this.EduTextbook.fieldsArray;
    this.queryParams = {
      where: {
        isDeleted: { $ne: true },
      },
    };
  }

  ngOnInit() {}
}
