FrontEnd/src/user/components/UsersList.js
// get list of users from outside source
get list of users from outside source
get list of users from outside source
function UsersList(props) {
	if (props.items.length === 0) {
		return (
			<Card className="text-center">
				<h2>No users found.</h2>
			</Card>
		);
	}
	return (
		<Container>
			<Row>
				<Col>
					<ListGroup>
						{props.items.map((user) => {
							return (
								<UserItem
									key={user._id}
									id={user._id}
									image={user.image}
									first_name={user.first_name}
									last_name={user.last_name}
									places={user.places}
								/>
							);
						})}
					</ListGroup>
				</Col>
			</Row>
		</Container>
	);
}
function UsersList ( props ) { if ( props . items . length === 0 ) { return ( < Card className = "text-center" > < h2 > No users found. < / h2 > < / Card > ) ; } return ( < Container > < Row > < Col > < ListGroup > { props . items . map ( ( user ) => { return ( < UserItem key = { user . _id } id = { user . _id } image = { user . image } first_name = { user . first_name } last_name = { user . last_name } places = { user . places } / > ) ; } ) } < / ListGroup > < / Col > < / Row > < / Container > ) ; }
get list of users from outside source
get list of users from outside source
//output no users found before we have any users in the list //or ouput a list of users if we have any // we map the list of js objects from props.items to jsx objects