import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { PickupShelfFilterComponent } from '../../shared/pickup-shelf-filter/pickup-shelf-filter.component';
import { PickupShelfOutMainSideViewComponent } from '../pickup-shelf-out-main-side-view/pickup-shelf-out-main-side-view.component';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'page-pickup-shelf-out-main',
  templateUrl: 'pickup-shelf-out-main.component.html',
  styleUrls: ['pickup-shelf-out-main.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: { class: 'page-pickup-shelf-out-main' },
  imports: [PickupShelfFilterComponent, PickupShelfOutMainSideViewComponent],
})
export class PickupShelfOutMainComponent implements OnInit {
  showFilter: boolean = false;

  get sideOutlet() {
    return this._activatedRoute?.parent?.children?.find((childRoute) => childRoute?.outlet === 'side')?.snapshot
      ?.routeConfig?.path;
  }

  constructor(private _activatedRoute: ActivatedRoute) {}

  ngOnInit(): void {
    this.showFilter = this.sideOutlet !== 'search';
  }
}
