import {Pressable, StyleSheet, Text, View} from 'react-native'; import React, {useEffect, useState} from 'react'; import {styles} from './styles'; import Header from '../header/header.component'; import Footer from '../footer/footer.component'; import CaptureButton from '../../design-system/capture-button/capture-button.component'; import FlipButton from '../../design-system/flip-button/flip-button.component'; import {globalStyles} from '../../../globalStyles'; import {getBranding} from '../../branding'; import Icon from 'react-native-vector-icons/Ionicons'; import { Camera, useCameraDevice, useCameraDevices, } from 'react-native-vision-camera'; type props = { webcamRef: React.MutableRefObject; userStep: number; findOutStepContent: () => { step: number; heading: string; subHeading: string; }; goBackUserSteps: (index?: number) => void; handlerUserSteps: () => void; buttonText: (userStep: number) => any; handleSingleCapturePhoto: (step: number) => void; skipGuidanceScreens?: boolean; }; /** * A component for capturing a selfie using the device's camera. * * @param {Object} props - The component props. * @param {Object} props.webcamRef - A mutable ref object for accessing the camera component. * @param {string} props.cameraMode - The type of camera to use (front or back). * @param {number} props.userStep - The current step in the user verification process. * @param {Function} props.findOutStepContent - A function that returns an object with the heading and subheading text for the current verification step. * @param {Function} props.goBackUserSteps - A function that allows the user to go back to the previous verification step. * @param {Function} props.handlerUserSteps - A function that handles the user's progress through the verification steps. * @param {Function} props.buttonText - A function that returns the text to display on the footer button based on the current verification step. * @param {Function} props.handleSingleCapturePhoto - A function that handles capturing a single photo for the current verification step. * @param {Function} props.flipCamera - A function that switches between the front and back camera. * @returns {JSX.Element} - The rendered component as a JSX element. */ const CaptureSelfie = ({ webcamRef, userStep, findOutStepContent, goBackUserSteps, handlerUserSteps, buttonText, handleSingleCapturePhoto, skipGuidanceScreens, }: props) => { const devices: any = useCameraDevices(); const device = useCameraDevice('front') const flipCamera = () => { }; return ( {/* Camera Screen */} {device && ( )} {/* Oval Screen */} {/* Content Screen */} { skipGuidanceScreens ? goBackUserSteps(2) : goBackUserSteps(); }} // style={({ pressed }) => pressed && styles.opacity} > {findOutStepContent()?.heading} {findOutStepContent()?.subHeading} pressed && styles.opacity}>