/**
 * 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, { Component } from 'react';
import {
  Header,
  Left,
  Icon,
  Body,
  Title,
  Subtitle,
  Right,
  Button,
  Text,
} from 'native-base';
import styles from './headerStyle';

const HeaderViewContainer = (props: any) => {
  const {
    leftPress,
    leftIcon,
    headerTitle,
    headerSubtitle,
    rightIcon,
    rightPress,
    onPressToPage,
    rightButtonText,
  } = props;
  return (
    <Header style={styles.headerLogin} >
      <Left style={styles.leftHeaderContainer}>
        {leftPress && (
          <Button onPress={leftPress} transparent icon>
            <Icon
              name={leftIcon}
              type="Ionicons"
              style={styles.headerLeftIcon}
            />
          </Button>
        )}
      </Left>
      <Body style={styles.headerBody}>
        {headerTitle && <Title style={styles.headertitle}>{headerTitle}</Title>}
        {headerSubtitle && <Subtitle>{headerSubtitle}</Subtitle>}
      </Body>
      <Right>
        {onPressToPage && (
          <Button transparent onPress={onPressToPage}>
            <Text style={styles.buttonText}>{rightButtonText}</Text>
          </Button>
        )}
        {rightIcon && (
          <Button onPress={rightPress} transparent icon>
            <Icon
              name={rightIcon}
              type="Ionicons"
              style={styles.headerLeftIcon}
            />
          </Button>
        )}
      </Right>
    </Header>
  );
};

export default HeaderViewContainer;
