text: import React from 'react';
  import { storiesOf } from '@storybook/react';
  
  import { View } from 'react-native';
  import { ListItem } from 'react-native-elements';
  
  storiesOf('ListItem|Using Map function', module)
  
    .add('Implemented with avatar', () => {
      const list = [
        {
          name: 'Amy Farha',
          avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg',
          subtitle: 'Vice President'
        },
        {
          name: 'Chris Jackson',
          avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg',
          subtitle: 'Vice Chairman'
        }
      ]
  
      return (
        <View>
          {
            list.map((l, i) => (
              <ListItem
                key={i}
                leftAvatar={{ source: { uri: l.avatar_url } }}
                title={l.name}
                subtitle={l.subtitle}
              />
            ))
          }
        </View>
      )
    })
  
    .add('Implemented with link and icon', () => {
      const list = [
        {
          title: 'Appointments',
          icon: 'av-timer'
        },
        {
          title: 'Trips',
          icon: 'flight-takeoff'
        }
      ]
  
      return (
        <View>
          {
            list.map((item, i) => (
              <ListItem
                key={i}
                title={item.title}
                leftIcon={{ name: item.icon }}
              />
            ))
          }
        </View>
      )
    });