Last active
February 9, 2018 12:57
-
-
Save viniciusdacal/d3691842430041a4b191a2fb9956c61f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const UserList = ({ isLoading, results }) => ( | |
<div> | |
<div> | |
<h1>Users</h1> | |
<a href="/users/create">New User</a> | |
</div> | |
<div> | |
{isLoading && <span>Loading...</span>} | |
{!isLoading && !results.length && ( | |
<span>No Results Found</span> | |
)} | |
{!isLoading && results.length > 0 && ( | |
<ul> | |
{result.map((user) => ( | |
<li key={user.id}>{user.name}</li> | |
))} | |
</ul> | |
)} | |
</div> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment