// Dependencies import React from 'react'; import { View } from 'react-native'; import { Button, Input, Text } from 'react-native-elements'; // Styles import styles from './styles'; /** * Form properties defintiions * @interface FormValues */ export interface FormValues { password: string; login: string; } /** * Props definition of {@link AuthForm} * @interface AuthFormProps */ export interface AuthFormProps { submitText: string; onSubmit: (formValues: FormValues) => Promise; loading: boolean; error?: string; } export function AuthForm(props: AuthFormProps): React.ReactElement { const { submitText, onSubmit, loading, error } = props; const [login, setLogin] = React.useState(''); const [password, setPassword] = React.useState(''); return ( {error}