import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { ActivatedRoute, RouterOutlet } from '@angular/router';
import {
  provideFilter,
  withQuerySettingsFactory,
  withQueryParamsSync,
} from '@isa/shared/filter';

function querySettingsFactory() {
  return inject(ActivatedRoute).snapshot.data['querySettings'];
}

@Component({
  selector: 'oms-feature-return-search',
  template: `<router-outlet></router-outlet>`,
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [RouterOutlet],
  providers: [
    provideFilter(
      withQuerySettingsFactory(querySettingsFactory),
      withQueryParamsSync(),
    ),
  ],
  host: {
    '[class]':
      '"flex flex-col gap-5 isa-desktop:gap-6 items-center overflow-x-hidden"',
  },
})
export class ReturnSearchComponent {}
