import React from 'react';
import {View, Image, Text, Pressable} from 'react-native';
import {styles} from './styles';
import Icon from 'react-native-vector-icons/Ionicons';
import Icon2 from 'react-native-vector-icons/Octicons';
// import branding from '../../branding';
import {globalStyles} from '../../../globalStyles';
import {getBranding} from '../../branding';
import {useMyStepsVerification} from '../../provider/verification.context';
const LOGO = '../../assets/logo.png';
type props = {
userStep: number;
findOutStepContent: () => {
step: number;
heading: string;
subHeading: string;
};
goBackUserSteps: (index?: number) => void;
allowSingle: boolean;
skipFirstScreen?: boolean;
};
/**
* A component for displaying the header of the user verification process, including the logo, heading, subheading, and navigation buttons.
*
* @param {Object} props - The component props.
* @param {number} props.userStep - The current step in the user verification process.
* @param {Function} props.findOutStepContent - A function that returns the content (heading and subheading) for the current step.
* @param {Function} props.goBackUserSteps - A function that allows the user to go back to the previous verification step.
* @returns {JSX.Element} - The rendered component as a JSX element.
*/
function Header({
userStep,
findOutStepContent,
goBackUserSteps,
allowSingle,
skipFirstScreen,
}: props) {
const context = useMyStepsVerification();
return (
<>
{userStep !== 10 && userStep !== 11 && userStep !== 12 && (
<>
{userStep === 1 &&
(!context.skipFunc ? (
{/* */}
{findOutStepContent()?.heading}
) : (
{/* */}
{findOutStepContent()?.heading}
{
context.skipFunc();
}}>
Skip
))}
{userStep !== 1 && (
{
if (userStep == 3 && !allowSingle) {
goBackUserSteps(2);
} else {
goBackUserSteps();
}
}}
style={({pressed}) => pressed && styles.opacity}>
{!((userStep == 2 || userStep == 3) && skipFirstScreen) && (
)}
{userStep === 1 && (
)}
{findOutStepContent()?.heading}
{findOutStepContent()?.subHeading}
{!context.skipFunc ? (
pressed && styles.opacity}>
) : (
{
context.skipFunc();
}}>
Skip
)}
)}
>
)}
>
);
}
export default Header;