import { JsonPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import {
  ReturnProcessQuestion,
  ReturnProcessQuestionType,
} from '@isa/oms/data-access';
import { ReturnProcessSelectQuestionComponent } from '../return-process-select-question/return-process-select-question.component';
import { ReturnProcessProductQuestionComponent } from '../return-process-product-question/return-process-product-question.component';
import { ReturnProcessChecklistQuestionComponent } from '../return-process-checklist-question/return-process-checklist-question.component';
import { ReturnProcessInfoQuestionComponent } from '../return-process-info-question/return-process-info-question.component';

@Component({
  selector: 'oms-feature-return-process-questions-renderer',
  templateUrl: './return-process-questions-renderer.component.html',
  styleUrls: ['./return-process-questions-renderer.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [
    JsonPipe,
    ReturnProcessSelectQuestionComponent,
    ReturnProcessProductQuestionComponent,
    ReturnProcessChecklistQuestionComponent,
    ReturnProcessInfoQuestionComponent,
  ],
})
export class ReturnProcessQuestionsRendererComponent {
  ReturnProcessQuestionType = ReturnProcessQuestionType;
  returnProcessId = input.required<number>();

  questions = input.required<ReturnProcessQuestion[]>();
}
