import { Steps } from '@/app/(tabs)/user-message'; import ChoicePhoto from '@/assets/icons/svg/choicePhoto.svg'; import LookSvg from '@/assets/icons/svg/look.svg'; import { ThemedText } from '@/components/ThemedText'; import { FileUploadItem } from '@/lib/background-uploader/types'; import { useTranslation } from 'react-i18next'; import { Alert, Image, StyleSheet, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import FilesUploader from '../file-upload/files-uploader'; import StepButton from '../ui/button/stepButton'; interface Props { setSteps?: (steps: Steps) => void; fileData: FileUploadItem[]; setFileData: (fileData: FileUploadItem[]) => void; isLoading: boolean; handleUser: () => void; avatar: string; } export default function Look(props: Props) { const { fileData, setFileData, isLoading, handleUser, avatar } = props; const { t } = useTranslation(); const insets = useSafeAreaInsets(); return ( {t('auth.userMessage.look', { ns: 'login' })} {t('auth.userMessage.avatarText', { ns: 'login' })} {"\n"} {t('auth.userMessage.avatorText2', { ns: 'login' })} {fileData[0]?.preview || fileData[0]?.previewUrl ? ( ) : avatar ? ( ) : ( )} { setFileData(fileData as FileUploadItem[]); }} showPreview={false} children={ {t('auth.userMessage.choosePhoto', { ns: 'login' })} } /> { if (fileData[0]?.preview || fileData[0]?.previewUrl || avatar) { handleUser() } else { Alert.alert(t('auth.userMessage.avatarRequired', { ns: 'login' })) } }} isLoading={isLoading} bg="#FFFFFF" color="#4C320C" /> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#AC7E35', paddingHorizontal: 24, justifyContent: 'space-between', }, contentContainer: { flex: 1, alignItems: 'center', gap: 28 }, title: { fontSize: 32, lineHeight: 36, fontWeight: 'bold', color: '#FFFFFF', }, subtitle: { fontSize: 14, color: "#fff", textAlign: 'center', marginBottom: 16, }, avatarImage: { borderRadius: 150, width: 215, height: 215, marginBottom: 16, }, uploadButton: { width: '100%', borderRadius: 999, paddingHorizontal: 16, paddingVertical: 13, alignItems: 'center', backgroundColor: '#FFF8DE', flexDirection: 'row', gap: 8, }, uploadButtonText: { color: '#4C320C' }, footer: { width: '100%', } });