import SelfieCapture from '@incodetech/welcome/camera/CaptureSelfie';
import type { WorkflowNode } from './types';
import { emptyFunc } from '@incode/utils';

type SelfieProps = {
  token: string;
  config: WorkflowNode['moduleConfiguration'];
  goNext: () => void;
};

const Selfie = ({ token, config, goNext }: SelfieProps) => {
  return (
    <SelfieCapture
      onSuccess={goNext}
      showPreview={config.showPreview}
      assistedOnboarding={config.assistedOnboarding}
      renderRetries={false}
      isSecondId={false}
      captureAttempts={config.captureAttempts}
      autoCaptureTimeout={config.autoCaptureTimeout}
      isRecordingEnabled={config.enableFaceRecording}
      skipProcessFace
      showTutorial={config.showTutorial}
      ageAssurance={config.ageAssurance}
      token={{ token }}
      onLog={emptyFunc}
    />
  );
};

export default Selfie;
