/**
 * 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 {
  Container,
  List,
  ListItem,
  Left,
  Thumbnail,
  Body,
  Text,
} from 'native-base';
import { FlatList } from 'react-native';

import styles from './style';

const ArtboardchatListView = (props) => {
  return (
    <Container styles={styles.container}>
      <FlatList
        data={props.chatUser}
        style={styles.listParentSection}
        keyExtractor={(item, index) => index.toString()}
        renderItem={({ item: user }) => (
          <ListItem avatar style={styles.userlistSecton}>
            <Left style={styles.userImageSection}>
              <Thumbnail source={user.image} style={styles.userImage} />
            </Left>
            <Body style={[styles.bodySection]}>
              <Text style={styles.userName}>{user.name}</Text>
              <Text style={styles.userDesc} numberOfLines={1}>
                {user.description}
              </Text>
            </Body>
          </ListItem>
        )}
      />
    </Container>
  );
};

export default ArtboardchatListView;
