/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */

import React from 'react';
import { Label, Item, Input } from 'native-base';
import styles from './style';

interface InputBlockProps {
  onChangeText: (text: string) => void;
  name: string;
  value: string;
  disabled?: boolean;
  type?: string;
}

const InputBlock = (props: InputBlockProps) => (
  <Item stackedLabel>
    <Label style={styles.capitalize}>{props.name}</Label>
    <Input
      onChangeText={props.onChangeText}
      value={props.value}
      disabled={props.disabled}
      secureTextEntry={props.type === 'password'}
    />
  </Item>
);

export default InputBlock;
