import React, { FC } from 'react' import { Text, View } from 'react-native' import { Button, Input } from '..' import s from './styles' import { IWaitingListViewProps } from './types' const WaitingListView: FC = ({ styles, texts, onPressButton, data, isSuccess, isLoading, }) => { const { firstName, lastName, email, emailError, lastNameError, firstNameError, onChangeEmail, onChangeFirstName, onChangeLastName, } = data const getIsDataValid = () => firstName.length > 0 && lastName.length > 0 && email.length > 0 && !emailError && !lastNameError && !firstNameError const isDataValid = getIsDataValid() const buttonStyle = isDataValid ? styles?.button : styles?.buttonDisabled ? styles?.buttonDisabled : styles?.button return ( {isSuccess ? ( {texts?.successTitle || `You've been added to the waiting list!`} {texts?.successMessage || `You'll be notified if tickets become available.`} ) : ( <> {texts?.title || 'Waiting list'}